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

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

public class IndicesSelector
extends AbstractCollection
implements FieldEditor, HTMLEditor

A collection editor that uses the value of an index field to select objects.


Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractCollection
autoUpdate, collection, filter, isEditor, itemView, model, rowsPerPageChooser, sorter, substance, viewableItems
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
column, context, description, height, isCellViewer, label, parentView, row, table, width
 
Constructor Summary
IndicesSelector(ViewFactory factory, DisplayContext context, CollectionItem collection, Object substance, CollectionModel model, CollectionItemView itemView)
           
 
Method Summary
 void commit()
          Commits the changes in this editor.
 void genHTML(PrintWriter out)
          Generate the HTML code for the editor.
 Object getValue()
          Gets the value of the edited object.
 String objectsToString()
           
 void onSetFocus(Object param)
          Called when the focus is given to the editor
 boolean readValue(Object parameter)
          Convert a parameter value (String or FileParameter) of an HTTP request parameter to an object.
 void setEditedType(ClassItem type)
          Sets the type of the edited value
 void setEmbedded(boolean embedded)
          Sets wether the editor is embedded in a view.
 void sort()
          Sorts the collection with the column index stored in the context if any.
 void updateModel(Object substance)
          Updates the collection model
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractCollection
checkRange, genHeader, genHeader, getCollectionModel, getField, getObject, getSubstance, init, isEditor, isEnabled, onAddExistingToCollection, onAddToCollection, onFirst, onLast, onNext, onPrevious, onRefreshCollection, onRemove, onRemoveFromCollection, onTableInvoke, onView, onView, onViewObject, removeLink, setAutoUpdate, setEditor, setEnabled, setField, setRowsPerPage, setSelected, setSubstance, setValue, showRefreshButton, sortLink, viewLink
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
close, 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.FieldEditor
isEnabled, setEnabled
 
Methods inherited from interface org.objectweb.jac.aspects.gui.FieldView
getField, getSubstance, setAutoUpdate, setField, setSubstance, setValue
 
Methods inherited from interface org.objectweb.jac.aspects.gui.View
close, getContext, getDescription, getFactory, getLabel, getMessage, getParentView, getRootView, getStyle, getViewBorder, isClosed, isDescendantOf, setContext, setDescription, setFactory, setFocus, setLabel, setMessage, setParentView, setSize, setStyle, setViewBorder
 
Methods inherited from interface org.objectweb.jac.aspects.gui.ViewIdentity
equalsView, equalsView, getParameters, getType, setParameters, setType
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.HTMLEditor
setAttribute
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.HTMLViewer
setStyleSheet
 

Constructor Detail

IndicesSelector

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

setEditedType

public void setEditedType(ClassItem type)
Description copied from interface: FieldEditor
Sets the type of the edited value

Specified by:
setEditedType in interface FieldEditor
Parameters:
type - the type of the edited value

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

updateModel

public void updateModel(Object substance)
Description copied from interface: CollectionView
Updates the collection model

Specified by:
updateModel in interface CollectionView
Overrides:
updateModel in class AbstractCollection

commit

public void commit()
Description copied from interface: FieldEditor
Commits the changes in this editor.

Specified by:
commit in interface FieldEditor

getValue

public Object getValue()
Description copied from interface: FieldEditor
Gets the value of the edited object.

Specified by:
getValue in interface FieldEditor
Returns:
an object of the edited type

setEmbedded

public void setEmbedded(boolean embedded)
Description copied from interface: FieldEditor
Sets wether the editor is embedded in a view.

Specified by:
setEmbedded in interface FieldEditor

onSetFocus

public void onSetFocus(Object param)
Description copied from interface: FieldEditor
Called when the focus is given to the editor

Specified by:
onSetFocus in interface FieldEditor
Parameters:
param - an optional parameter

objectsToString

public String objectsToString()

genHTML

public void genHTML(PrintWriter out)
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.

readValue

public boolean readValue(Object parameter)
Description copied from interface: HTMLEditor
Convert a parameter value (String or FileParameter) of an HTTP request parameter to an object.

Specified by:
readValue in interface HTMLEditor