JAC project
AOPSYS
CEDRIC & LIP6 labs

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

java.lang.Object
  |
  +--org.objectweb.jac.aspects.gui.web.AbstractView
        |
        +--org.objectweb.jac.aspects.gui.web.AbstractCollection
              |
              +--org.objectweb.jac.aspects.gui.web.Table
All Implemented Interfaces:
CollectionListener, CollectionView, FieldView, HTMLViewer, TableListener, View, ViewIdentity

public class Table
extends AbstractCollection
implements HTMLViewer, TableListener


Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractCollection
autoUpdate, collection, isEditor, itemView, model, substance
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
column, context, description, height, isCellViewer, label, parentView, row, table, width
 
Constructor Summary
Table(ViewFactory factory, DisplayContext context, CollectionItem collection, Object substance, ExtendedTableModel model, CollectionItemView itemView)
           
 
Method Summary
protected  void clearCellEditors()
          Removes editors of embedded added object
protected  void clearDefaultEditors()
          Removes editors of embedded added object
protected  void clearEmbeddedEditors()
          Removes editors of embedded added object
 void close()
          Close this view.
 void genHTML(PrintWriter out)
          Generate the HTML code for the editor.
protected  HTMLViewer getFieldEditor(FieldItem field, Object substance)
          Returns a cell editor for a field of an object.
protected  void initAddedObject(Object addedObject, Object defaultsObject)
          Initialize fields of added object from one of defaultsObject
 void onCellSelection(int row, int col)
          Called when a cell is selected.
 void onEmbeddedAddToCollection()
           
 void onHeaderClick(int column)
          Called when a column header is "clicked".
 View onRowEvent(int row, int col)
           
 void onSetDefaults()
           
protected  void setCellRenderers()
           
 void setColumnsInfo(String[] headers, FieldItem[] fields, ClassItem[] classes, ClassItem[] viewerClasses)
           
 void sort()
          Sorts the collection with the column index stored in the context if any.
 void sort(int column)
          Sorts the collection.
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractCollection
genAdderAndRemover, getCollectionModel, getField, isEditor, isEnabled, onAddExistingToCollection, onAddToCollection, onFirst, onLast, onNext, onPrevious, onRemove, onRemoveFromCollection, onTableInvoke, onView, onView, onViewObject, removeLink, setAutoUpdate, setEditor, setEnabled, setField, setSelected, setSubstance, setValue, sortLink, updateModel, viewLink
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
equals, eventURL, eventURL, genBody, genPage, genStyleSheets, getCloseBorder, getContext, getDescription, getFactory, getId, getId, getLabel, getMessage, getOpenBorder, getParameters, getParentView, getRootView, getStyle, getType, getViewBorder, hashCode, iconElement, iconElement, isClosed, isDescendantOf, isInForm, printAttributes, setAttribute, 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, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.HTMLViewer
setStyleSheet
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.CollectionListener
onAddExistingToCollection, onAddToCollection, onFirst, onLast, onNext, onPrevious, onRemove, onRemoveFromCollection, onTableInvoke, onView, onViewObject
 
Methods inherited from interface org.objectweb.jac.aspects.gui.View
getContext, getDescription, getFactory, getLabel, getMessage, getParentView, getRootView, getStyle, getViewBorder, isClosed, isDescendantOf, setContext, setDescription, setFactory, setFocus, setHeight, setLabel, setMessage, setParentView, setStyle, setViewBorder, setWidth, validate
 
Methods inherited from interface org.objectweb.jac.aspects.gui.ViewIdentity
getParameters, getType, setParameters, setType
 

Constructor Detail

Table

public Table(ViewFactory factory,
             DisplayContext context,
             CollectionItem collection,
             Object substance,
             ExtendedTableModel model,
             CollectionItemView itemView)
Method Detail

setColumnsInfo

public void setColumnsInfo(String[] headers,
                           FieldItem[] fields,
                           ClassItem[] classes,
                           ClassItem[] viewerClasses)

setCellRenderers

protected void setCellRenderers()

sort

public void sort()
Description copied from class: AbstractCollection
Sorts the collection with the column index stored in the context if any.

Specified by:
sort in class AbstractCollection

sort

public void sort(int column)
Sorts the collection.

Parameters:
column - the index of the column used to sort

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

getFieldEditor

protected HTMLViewer getFieldEditor(FieldItem field,
                                    Object substance)
Returns a cell editor for a field of an object. Editors are cached, so you'll always get the same object for the same field and substance, unless clearCellEditors() is called.

See Also:
clearCellEditors()

clearEmbeddedEditors

protected void clearEmbeddedEditors()
Removes editors of embedded added object


clearDefaultEditors

protected void clearDefaultEditors()
Removes editors of embedded added object


clearCellEditors

protected void clearCellEditors()
Removes editors of embedded added object


close

public void close()
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

initAddedObject

protected void initAddedObject(Object addedObject,
                               Object defaultsObject)
Initialize fields of added object from one of defaultsObject


onCellSelection

public void onCellSelection(int row,
                            int col)
Description copied from interface: TableListener
Called when a cell is selected.

Specified by:
onCellSelection in interface TableListener
Parameters:
col - column index of the selected cell

onEmbeddedAddToCollection

public void onEmbeddedAddToCollection()
Specified by:
onEmbeddedAddToCollection in interface TableListener

onSetDefaults

public void onSetDefaults()
Specified by:
onSetDefaults in interface TableListener

onHeaderClick

public void onHeaderClick(int column)
Description copied from interface: TableListener
Called when a column header is "clicked".

Specified by:
onHeaderClick in interface TableListener
Parameters:
column - column index of the selected header

onRowEvent

public View onRowEvent(int row,
                       int col)
Specified by:
onRowEvent in interface TableListener

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli