Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jac.aspects.gui.web
Class AbstractCollection  view AbstractCollection download AbstractCollection.java

java.lang.Object
  extended byjac.aspects.gui.web.AbstractView
      extended byjac.aspects.gui.web.AbstractCollection
All Implemented Interfaces:
CollectionListener, jac.aspects.gui.View
Direct Known Subclasses:
CompactList, IndicesSelector, List, Table

public abstract class AbstractCollection
extends AbstractView
implements CollectionListener


Field Summary
(package private)  jac.aspects.gui.MethodView addButton
           
protected  jac.core.rtti.CollectionItem collection
           
protected  jac.aspects.gui.CollectionModel model
           
(package private)  jac.aspects.gui.MethodView removeButton
           
(package private)  int rowsPerPage
           
(package private)  int selected
           
(package private)  boolean showRowNumbers
           
(package private)  int sortColumn
           
(package private)  boolean split
           
(package private)  int startIndex
           
protected  java.lang.Object substance
           
 
Fields inherited from class jac.aspects.gui.web.AbstractView
closed, column, context, description, factory, height, isCellViewer, javascript, label, message, parameters, parentView, row, style, styleSheet, table, type, viewBorder, width
 
Constructor Summary
AbstractCollection()
           
AbstractCollection(jac.aspects.gui.ViewFactory factory, jac.aspects.gui.DisplayContext context, jac.core.rtti.CollectionItem collection, java.lang.Object substance, jac.aspects.gui.CollectionModel model)
           
 
Method Summary
protected  void genAdderAndRemover(java.io.PrintWriter out)
          Generate HTML for adder, remover, and prev/next buttons
(package private)  void genCollectionEvent(java.io.PrintWriter out, java.lang.String event, java.lang.String icon, java.lang.String label)
          Generate HTML code for a collection's event (add, remove, ...)
 jac.aspects.gui.CollectionModel getCollectionModel()
           
 jac.core.rtti.FieldItem getField()
           
 void onAddExistingToCollection()
          Called when the user wants to add an object to the collection, without creating a new one even if the collection is "autocreate".
 void onAddToCollection()
          Called when the user wants to add an object to the collection.
 void onFirst()
          Display to the first page of items
 void onLast()
          Display to the last page of items
 void onNext()
          Display the next page of items
 void onPrevious()
          Display the previous page of items
 void onRemove(int index)
          Called when the user selects an item to remove it.
 void onRemoveFromCollection()
          Called when the user wants to remove an object to the collection.
 void onTableInvoke(int index, java.lang.String methodName)
          Called when a method is called on an object belonging to the collection.
 void onView(int index)
          Called when the user selects an item to view it.
 void onView(java.lang.Object object)
           
protected  java.lang.String removeLink(int position)
          Returns an HTML link to remove the element at a given position.
 void setField(jac.core.rtti.FieldItem field)
           
 void setSelected(int index)
           
 void setSubstance(java.lang.Object substance)
           
 void setValue(java.lang.Object value)
           
abstract  void sort()
          Sorts the collection with the column index stored in the context if any.
protected  java.lang.String sortLink(int column, java.lang.String text)
          Build an HTML link with an image showing if a column is used to sort the collection
 void updateModel(java.lang.Object substance)
           
protected  java.lang.String viewLink(int position)
           
 
Methods inherited from class jac.aspects.gui.web.AbstractView
close, equals, eventURL, eventURL, genBody, genPage, getCloseBorder, getContext, getDescription, getFactory, getId, getId, getLabel, getMessage, getOpenBorder, getParameters, getParentView, getRootView, getStyle, getType, getViewBorder, iconElement, iconElement, isClosed, isInForm, setColumn, setContext, setDescription, setFactory, setFocus, setHeight, setLabel, setMessage, setParameters, setParentView, setRow, setStyle, setStyleSheet, setTable, setType, setViewBorder, setWidth, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jac.aspects.gui.View
getSubstance, refreshView, refreshViewItem
 

Field Detail

collection

protected jac.core.rtti.CollectionItem collection

substance

protected java.lang.Object substance

model

protected jac.aspects.gui.CollectionModel model

addButton

jac.aspects.gui.MethodView addButton

removeButton

jac.aspects.gui.MethodView removeButton

selected

int selected

sortColumn

int sortColumn

rowsPerPage

int rowsPerPage

split

boolean split

showRowNumbers

boolean showRowNumbers

startIndex

int startIndex
Constructor Detail

AbstractCollection

public AbstractCollection(jac.aspects.gui.ViewFactory factory,
                          jac.aspects.gui.DisplayContext context,
                          jac.core.rtti.CollectionItem collection,
                          java.lang.Object substance,
                          jac.aspects.gui.CollectionModel model)

AbstractCollection

public AbstractCollection()
Method Detail

setSubstance

public void setSubstance(java.lang.Object substance)

getCollectionModel

public jac.aspects.gui.CollectionModel getCollectionModel()

genCollectionEvent

void genCollectionEvent(java.io.PrintWriter out,
                        java.lang.String event,
                        java.lang.String icon,
                        java.lang.String label)
Generate HTML code for a collection's event (add, remove, ...)


sort

public abstract void sort()
Sorts the collection with the column index stored in the context if any.


onView

public void onView(java.lang.Object object)

genAdderAndRemover

protected void genAdderAndRemover(java.io.PrintWriter out)
Generate HTML for adder, remover, and prev/next buttons


setSelected

public void setSelected(int index)

setField

public void setField(jac.core.rtti.FieldItem field)

getField

public jac.core.rtti.FieldItem getField()

setValue

public void setValue(java.lang.Object value)

updateModel

public void updateModel(java.lang.Object substance)

onView

public void onView(int index)
Description copied from interface: CollectionListener
Called when the user selects an item to view it.

Specified by:
onView in interface CollectionListener

onRemove

public void onRemove(int index)
Description copied from interface: CollectionListener
Called when the user selects an item to remove it.

Specified by:
onRemove in interface CollectionListener

onTableInvoke

public void onTableInvoke(int index,
                          java.lang.String methodName)
Description copied from interface: CollectionListener
Called when a method is called on an object belonging to the collection.

Specified by:
onTableInvoke in interface CollectionListener

onAddToCollection

public void onAddToCollection()
Description copied from interface: CollectionListener
Called when the user wants to add an object to the collection.

Specified by:
onAddToCollection in interface CollectionListener

onAddExistingToCollection

public void onAddExistingToCollection()
Description copied from interface: CollectionListener
Called when the user wants to add an object to the collection, without creating a new one even if the collection is "autocreate".

Specified by:
onAddExistingToCollection in interface CollectionListener

onRemoveFromCollection

public void onRemoveFromCollection()
Description copied from interface: CollectionListener
Called when the user wants to remove an object to the collection.

Specified by:
onRemoveFromCollection in interface CollectionListener

onNext

public void onNext()
Description copied from interface: CollectionListener
Display the next page of items

Specified by:
onNext in interface CollectionListener

onLast

public void onLast()
Description copied from interface: CollectionListener
Display to the last page of items

Specified by:
onLast in interface CollectionListener

onPrevious

public void onPrevious()
Description copied from interface: CollectionListener
Display the previous page of items

Specified by:
onPrevious in interface CollectionListener

onFirst

public void onFirst()
Description copied from interface: CollectionListener
Display to the first page of items

Specified by:
onFirst in interface CollectionListener

removeLink

protected java.lang.String removeLink(int position)
Returns an HTML link to remove the element at a given position.


viewLink

protected java.lang.String viewLink(int position)

sortLink

protected java.lang.String sortLink(int column,
                                    java.lang.String text)
Build an HTML link with an image showing if a column is used to sort the collection