org.objectweb.jac.aspects.gui.web
Class CollectionItemView

java.lang.Object
  |
  +--org.objectweb.jac.aspects.gui.web.AbstractView
        |
        +--org.objectweb.jac.aspects.gui.web.CollectionItemView
All Implemented Interfaces:
AbstractCollectionItemView, CollectionItemViewListener, HTMLViewer, View, ViewIdentity

public class CollectionItemView
extends AbstractView
implements HTMLViewer, CollectionItemViewListener, AbstractCollectionItemView

Component used to display elements of a collection, with "prev" and "next" buttons to go to the previous or next element of the collection easily. Can be useful.


Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
column, context, description, height, isCellViewer, label, parentView, row, table, width
 
Constructor Summary
CollectionItemView(View view, CollectionPosition coll, String viewType, String[] viewParams, View hiddenView)
           
 
Method Summary
 void close(boolean validate)
          Close this view.
protected  CompositeView findPanel()
           
 void genHTML(PrintWriter out)
          Generate the HTML code for the editor.
 CollectionItem getCollection()
          Gets the collection item associated with the view
 int getCurrent()
          Gets the position in the collection of the current item
 View getView()
           
 void onBackToCollection()
          Called when the user wants to go back to the view of the collection
 void onNextInCollection()
          Called when the user wants to go to the next element in the collection
 void onPreviousInCollection()
          Called when the user wants to go to the previous element in the collection
 void onRemoveInCollection()
          Called when the user wants to remove the selected item from the collection
 void setCollection(CollectionItem coll)
          Sets the collection item associated with the view
 void setCurrent(int index)
          Sets the position in the collection of the current item
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
closeForm, equalsView, equalsView, eventURL, eventURL, genBody, genEventAndActionButton, genPage, genStyleSheets, getBaseURL, getCloseBorder, getContext, getDescription, getFactory, getId, getId, getLabel, getMessage, getOpenBorder, getParameters, getParentView, getRootView, getStyle, getType, getViewBorder, iconElement, iconElement, isClosed, isDescendantOf, isInForm, openForm, printAttributes, setAttribute, setColumn, setContext, setDescription, setFactory, setFocus, setLabel, setMessage, setParameters, setParentView, setRow, setSize, setStyle, setStyleSheet, setTable, setType, setViewBorder, showButton, showFormButtons, showFormButtons
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.HTMLViewer
setStyleSheet
 

Constructor Detail

CollectionItemView

public CollectionItemView(View view,
                          CollectionPosition coll,
                          String viewType,
                          String[] viewParams,
                          View hiddenView)
Parameters:
view - the initial embedded view
coll - the initial position in the collection
viewType - the type of the view
hiddenView - the hidden view
Method Detail

getView

public View getView()
Specified by:
getView in interface AbstractCollectionItemView

close

public void close(boolean validate)
Description copied from interface: View
Close this view. This should be upcalled when the view is closed in order to free resources or close other dependant views.

Specified by:
close in interface View
Overrides:
close in class AbstractView
Parameters:
validate - wether to validate any value contained in editors.

setCollection

public void setCollection(CollectionItem coll)
Description copied from interface: AbstractCollectionItemView
Sets the collection item associated with the view

Specified by:
setCollection in interface AbstractCollectionItemView
Parameters:
coll - a collection item

getCollection

public CollectionItem getCollection()
Description copied from interface: AbstractCollectionItemView
Gets the collection item associated with the view

Specified by:
getCollection in interface AbstractCollectionItemView
Returns:
collection item

setCurrent

public void setCurrent(int index)
Description copied from interface: AbstractCollectionItemView
Sets the position in the collection of the current item

Specified by:
setCurrent in interface AbstractCollectionItemView
Parameters:
index - position in collection (from 0 to collection size-1)

getCurrent

public int getCurrent()
Description copied from interface: AbstractCollectionItemView
Gets the position in the collection of the current item

Specified by:
getCurrent in interface AbstractCollectionItemView
Returns:
position in collection

genHTML

public void genHTML(PrintWriter out)
             throws IOException
Description copied from interface: HTMLViewer
Generate the HTML code for the editor.

Specified by:
genHTML in interface HTMLViewer
Parameters:
out - the writer where to write the HTML code.
IOException

onNextInCollection

public void onNextInCollection()
Description copied from interface: CollectionItemViewListener
Called when the user wants to go to the next element in the collection

Specified by:
onNextInCollection in interface CollectionItemViewListener

onPreviousInCollection

public void onPreviousInCollection()
Description copied from interface: CollectionItemViewListener
Called when the user wants to go to the previous element in the collection

Specified by:
onPreviousInCollection in interface CollectionItemViewListener

findPanel

protected CompositeView findPanel()

onBackToCollection

public void onBackToCollection()
Description copied from interface: CollectionItemViewListener
Called when the user wants to go back to the view of the collection

Specified by:
onBackToCollection in interface CollectionItemViewListener

onRemoveInCollection

public void onRemoveInCollection()
Description copied from interface: CollectionItemViewListener
Called when the user wants to remove the selected item from the collection

Specified by:
onRemoveInCollection in interface CollectionItemViewListener