JAC project
AOPSYS
CEDRIC & LIP6 labs

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

java.lang.Object
  |
  +--org.objectweb.jac.aspects.gui.web.AbstractView
        |
        +--org.objectweb.jac.aspects.gui.web.AbstractFieldEditor
              |
              +--org.objectweb.jac.aspects.gui.web.ObjectChooser
All Implemented Interfaces:
ChoiceListener, FieldEditor, FieldUpdate, FieldView, HTMLEditor, HTMLViewer, ReferenceEditor, View, ViewIdentity

public class ObjectChooser
extends AbstractFieldEditor
implements HTMLEditor, ChoiceListener, ReferenceEditor

This is a special value editor that allows the user to choose a value within a set of object of a given type.


Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractFieldEditor
field, isEmbedded, setter, substance, value
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
column, context, description, height, isCellViewer, label, parentView, row, table, width
 
Constructor Summary
ObjectChooser(Object substance, FieldItem reference, ComboBoxModel model, boolean isEditable)
          Constructs a new object chooser.
 
Method Summary
 void close()
          Close this view.
protected  boolean doReadValue(Object parameter)
           
 void genHTML(PrintWriter out)
          Generate the HTML code for the editor.
 Object getValue()
          Gets the value of the edited object.
 boolean isEditable()
           
 void onCreateObject()
           
 void setEditable(boolean editable)
           
 void setValue(Object value)
          Sets the value to display
 
Methods inherited from class org.objectweb.jac.aspects.gui.web.AbstractFieldEditor
commit, fieldUpdated, getField, isEnabled, onSetFocus, readValue, setAutoUpdate, setEmbedded, setEnabled, setField, setSubstance
 
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.HTMLEditor
commit, readValue, setAttribute
 
Methods inherited from interface org.objectweb.jac.aspects.gui.web.HTMLViewer
setStyleSheet
 
Methods inherited from interface org.objectweb.jac.aspects.gui.FieldEditor
commit, isEnabled, onSetFocus, setEmbedded, setEnabled
 
Methods inherited from interface org.objectweb.jac.aspects.gui.FieldView
getField, setAutoUpdate, setField, setSubstance
 
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

ObjectChooser

public ObjectChooser(Object substance,
                     FieldItem reference,
                     ComboBoxModel model,
                     boolean isEditable)
Constructs a new object chooser.

Parameters:
substance -
reference - the subtance reference that is affected by this chooser (can be null)
isEditable - should the user be allowed to enter a new value
Method Detail

setValue

public void setValue(Object value)
Description copied from interface: FieldView
Sets the value to display

Specified by:
setValue in interface FieldView
Overrides:
setValue in class AbstractFieldEditor
Parameters:
value - the value

getValue

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

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

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 AbstractFieldEditor

isEditable

public boolean isEditable()
Specified by:
isEditable in interface ReferenceEditor

setEditable

public void setEditable(boolean editable)
Specified by:
setEditable in interface ReferenceEditor

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.

doReadValue

protected boolean doReadValue(Object parameter)
Specified by:
doReadValue in class AbstractFieldEditor

onCreateObject

public void onCreateObject()
Specified by:
onCreateObject in interface ChoiceListener

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli