|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.amattioli.applicate.browsing.ListBrowserImpl<I,T>
I - Identifier class for the browsing entitiesT - class of the browsing entitiespublic class ListBrowserImpl<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>
Standard implementation of the ListBrowser interface.
| Field Summary | |
|---|---|
protected List<T> |
content
|
protected Integer |
selectedIndex
|
| Constructor Summary | |
|---|---|
protected |
ListBrowserImpl()
Create a new ListBrowser. |
|
ListBrowserImpl(Class<T> entityClass)
Create a new repository given the class of the browsing entities. |
|
ListBrowserImpl(it.amattioli.dominate.Repository<I,T> repository)
Create a new ListBrowser given the repository that contains the browsing entities. |
| Method Summary | ||
|---|---|---|
protected void |
addCommandListener(CommandListener listener)
|
|
protected void |
addCommandListener(CommandListener listener,
CommandResult... results)
|
|
void |
addContentChangeListener(ContentChangeListener listener)
Add a listener for events fired when the browser content changes. |
|
void |
addOrder(String property)
Add a property that will be used to sort the browsing objects. |
|
void |
addOrder(String property,
boolean reverse)
|
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a listener for PropertyChangeEvent events. |
|
void |
addSelectionListener(SelectionListener listener)
Register a listener for the object selection. |
|
void |
commandDone(CommandEvent source)
This method will be called every time a CommandEvent is fired by
the command to which this listener has been added. |
|
static
|
createFor(Class<Q> entityClass)
Factory method that creates a new repository given the class of the browsing entities. |
|
static
|
createFor(it.amattioli.dominate.Repository<J,Q> repository)
Factory method that creates a new ListBrowser given the repository that contains the browsing entities. |
|
void |
deselect()
Removes the current selection. |
|
void |
fillCollection(Collection<? super T> toBeFilled)
Fill a collection with the browsing objects. |
|
protected void |
fireCommandEvent(CommandEvent source)
|
|
protected void |
fireContentChange()
|
|
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
|
|
it.amattioli.dominate.Filter |
getFilter()
Retrieves the filter object set by ListBrowser.setFilter(Filter). |
|
boolean |
getHasNext()
Indicate if there is an object next to the currently selected object. |
|
boolean |
getHasPrevious()
Indicate if there is an object previous to the currently selected object. |
|
List<T> |
getList()
Retrieves the list of the browsing objects. |
|
String |
getOrderProperty()
Retrieves the name of the property of the browsing objects that will be used to sort the list of browsing objects. |
|
protected it.amattioli.dominate.Repository<I,T> |
getRepository()
|
|
boolean |
getReverseOrder()
Indicates if the order is direct or reverse. |
|
Integer |
getSelectedIndex()
Retrieves the index of the object currently selected. |
|
T |
getSelectedObject()
Retrieves the object currently selected. |
|
ObjectBrowser<I,T> |
getSelectedObjectBrowser()
Retrieves a ObjectBrowser for the selected object. |
|
it.amattioli.dominate.Specification<T> |
getSpecification()
Retrieves the specification object set by ListBrowser.setSpecification(Specification) |
|
protected void |
invalidateContent()
|
|
boolean |
isEmptyList()
|
|
protected boolean |
isValidContent()
|
|
protected boolean |
isValidSelectionIndex(Integer index)
|
|
ObjectBrowser<I,T> |
newObjectBrowser()
Create a new ObjectBrowser for the currently selected object. |
|
void |
next()
Move the selection to the object next to the currently selected object. |
|
void |
previous()
Move the selection to the object previous to the currently selected object. |
|
protected void |
refreshContent()
|
|
protected T |
refreshObject(int index)
|
|
void |
release()
Releases eventually acquired resources. |
|
void |
removeContentChangeListener(ContentChangeListener listener)
Remove a listener for events fired when the browser content changes. |
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a listener for PropertyChangeEvent events. |
|
void |
removeSelectionListener(SelectionListener listener)
Remove a listener from the collection of the listeners that will be notified when an object is slected in this browser. |
|
void |
select(int index)
Select an object using its index inside the list retrieved using ListBrowser.getList(). |
|
void |
select(Integer index)
|
|
void |
select(T object)
Select an object. |
|
void |
setFilter(it.amattioli.dominate.Filter filter)
Set the criteria to be used to filter the browsing objects. |
|
void |
setOrder(String property)
Set the property that will be used to sort the browsing objects. |
|
void |
setOrder(String property,
boolean reverse)
Set the property that will be used to sort the browsing objects. |
|
protected void |
setRepository(it.amattioli.dominate.Repository<I,T> repository)
|
|
void |
setSpecification(it.amattioli.dominate.Specification<T> spec)
Set the specification to be used to filter the browsing objects. |
|
String |
toString()
|
|
void |
useObjectBrowserClass(Class<? extends ObjectBrowserImpl<I,T>> placeHolderClass)
Set the class that will be used by ListBrowser.newObjectBrowser(). |
|
protected void |
validateContent()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected List<T extends it.amattioli.dominate.Entity<I>> content
protected Integer selectedIndex
| Constructor Detail |
|---|
protected ListBrowserImpl()
setRepository(Repository)
public ListBrowserImpl(it.amattioli.dominate.Repository<I,T> repository)
repository - the repository that contains the browsing entitiespublic ListBrowserImpl(Class<T> entityClass)
entityClass - the class of the browsing entities| Method Detail |
|---|
public static <J extends Serializable,Q extends it.amattioli.dominate.Entity<J>> ListBrowserImpl<J,Q> createFor(Class<Q> entityClass)
entityClass - the class of the browsing entitiespublic static <J extends Serializable,Q extends it.amattioli.dominate.Entity<J>> ListBrowserImpl<J,Q> createFor(it.amattioli.dominate.Repository<J,Q> repository)
repository - the repository that contains the browsing entitiesprotected it.amattioli.dominate.Repository<I,T> getRepository()
protected void setRepository(it.amattioli.dominate.Repository<I,T> repository)
protected void invalidateContent()
protected boolean isValidContent()
protected void validateContent()
protected void refreshContent()
public void fillCollection(Collection<? super T> toBeFilled)
ListBrowserListBrowser.getList().
fillCollection in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>toBeFilled - the collection to be filledpublic List<T> getList()
ListBrowsersetCriteria.
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.
getList in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public boolean isEmptyList()
public void setFilter(it.amattioli.dominate.Filter filter)
ListBrowserListBrowser.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.
setFilter in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>filter - the criteria that will be used to filter the browsing objectspublic it.amattioli.dominate.Filter getFilter()
ListBrowserListBrowser.setFilter(Filter).
getFilter in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>ListBrowser.setFilter(Filter)public it.amattioli.dominate.Specification<T> getSpecification()
ListBrowserListBrowser.setSpecification(Specification)
getSpecification in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>ListBrowser.setSpecification(Specification)public void setSpecification(it.amattioli.dominate.Specification<T> spec)
ListBrowserListBrowser.getList() method will return only the objects that
satisfy the specification.
The browser will listen on property changes of the specification bean
so to refresh the browsing objects accordingly.
setSpecification in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>spec - the specification that will be used to filter the browsing objects
public void setOrder(String property,
boolean reverse)
ListBrowser
setOrder in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>property - the name of a property of the browsing objects that will be
used to sort the list of browsing objectsreverse - if true the objects will be sort in reverse order
public void addOrder(String property,
boolean reverse)
public void addOrder(String property)
ListBrowser
addOrder in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public void setOrder(String property)
ListBrowser
setOrder in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>property - the name of a property of the browsing objects that will be
used to sort the list of browsing objectspublic String getOrderProperty()
ListBrowser
getOrderProperty in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public boolean getReverseOrder()
ListBrowser
getReverseOrder in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public void select(int index)
ListBrowserListBrowser.getList().
After the selection a SelectionEvent will be notified to all
the objects that has been registered using
#addContentChangeListener(BrowserSelectionListener).
select in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>index - the index inside the list retrieved using ListBrowser.getList()
of the object to be selectedpublic void select(Integer index)
protected boolean isValidSelectionIndex(Integer index)
public void select(T object)
ListBrowserSelectionEvent will be notified to all
the objects that has been registered using
#addContentChangeListener(BrowserSelectionListener).
select in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>object - the object to be selectedpublic void deselect()
ListBrowserSelector.getSelectedObject() and ListBrowser.getSelectedIndex()
will return null.
deselect in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>protected T refreshObject(int index)
public T getSelectedObject()
Selector
getSelectedObject in interface Selector<T extends it.amattioli.dominate.Entity<I>>public Integer getSelectedIndex()
ListBrowserListBrowser.select(int).
getSelectedIndex in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public void next()
ListBrowser
next in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public boolean getHasNext()
ListBrowser
getHasNext in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public void previous()
ListBrowser
previous in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public boolean getHasPrevious()
ListBrowser
getHasPrevious in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public void commandDone(CommandEvent source)
CommandListenerCommandEvent is fired by
the command to which this listener has been added.
commandDone in interface CommandListenersource - the fired eventprotected void addCommandListener(CommandListener listener)
protected void addCommandListener(CommandListener listener,
CommandResult... results)
protected void fireCommandEvent(CommandEvent source)
public void useObjectBrowserClass(Class<? extends ObjectBrowserImpl<I,T>> placeHolderClass)
ListBrowserListBrowser.newObjectBrowser().
useObjectBrowserClass in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>placeHolderClass - the class that will be used by ListBrowser.newObjectBrowser()public ObjectBrowser<I,T> newObjectBrowser()
ListBrowserObjectBrowser for the currently selected object.
The object created will be an instance of the class set using
ListBrowser.useObjectBrowserClass(Class). If no object browser class was
specified ObjectBrowserImpl will be used.
newObjectBrowser in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>ObjectBrowserpublic ObjectBrowser<I,T> getSelectedObjectBrowser()
ListBrowserObjectBrowser for the selected object.
This ObjectBrowser will be created the first time
this method is called and will be linked to the currently
selected object. Every time a new object is elected in the browser
the ObjectBrowser will be notified so it can refresh
itself to contain the currently slected object.
getSelectedObjectBrowser in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>ObjectBrowser for the selected objectpublic void addPropertyChangeListener(PropertyChangeListener listener)
ListBrowserPropertyChangeEvent events.
addPropertyChangeListener in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>addPropertyChangeListener in interface it.amattioli.dominate.util.PropertyChangeEmitterlistener - a listener for PropertyChangeEvent eventspublic void removePropertyChangeListener(PropertyChangeListener listener)
ListBrowserPropertyChangeEvent events.
removePropertyChangeListener in interface ListBrowser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>removePropertyChangeListener in interface it.amattioli.dominate.util.PropertyChangeEmitterlistener - a listener for PropertyChangeEvent events
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
public void addSelectionListener(SelectionListener listener)
Selector
addSelectionListener in interface Selector<T extends it.amattioli.dominate.Entity<I>>listener - the listener to be registeredpublic void removeSelectionListener(SelectionListener listener)
Selector
removeSelectionListener in interface Selector<T extends it.amattioli.dominate.Entity<I>>listener - the listener to be removedpublic void release()
Browser
release in interface Browser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>public void addContentChangeListener(ContentChangeListener listener)
Browser
addContentChangeListener in interface Browser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>listener - the listener to be addedpublic void removeContentChangeListener(ContentChangeListener listener)
Browser
removeContentChangeListener in interface Browser<I extends Serializable,T extends it.amattioli.dominate.Entity<I>>listener - the listener to be removedprotected void fireContentChange()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||