JAC project
AOPSYS
CEDRIC & LIP6 labs

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

java.lang.Object
  |
  +--org.objectweb.jac.aspects.gui.web.AbstractView
        |
        +--org.objectweb.jac.aspects.gui.web.AbstractFieldEditor
All Implemented Interfaces:
FieldEditor, FieldUpdate, FieldView, View, ViewIdentity
Direct Known Subclasses:
AttachmentEditor, BooleanEditor, DateEditor, DateHourEditor, IndexSelector, ObjectChooser, PasswordFieldEditor, PrimitiveFieldEditor, TextEditor, URLEditor

public abstract class AbstractFieldEditor
extends AbstractView
implements FieldEditor, FieldUpdate


Field Summary
protected  FieldItem field
           
protected  boolean isEmbedded
           
protected  MethodItem setter
           
protected  Object substance
           
protected  Object value
           
 
Fields inherited from class org.objectweb.jac.aspects.gui.web.AbstractView
column, context, description, height, isCellViewer, label, parentView, row, table, width
 
Constructor Summary
AbstractFieldEditor(Object substance, FieldItem field)
           
 
Method Summary
 void close()
          Close this view.
 void commit()
          Commit editing by calling the setter method.
protected abstract  boolean doReadValue(Object parameter)
           
 void fieldUpdated(Object substance, FieldItem field, Object value, Object param)
          Upcalled when a field was modified.
 FieldItem getField()
           
 Object getValue()
          Gets the value of the edited object.
 boolean isEnabled()
           
 void onSetFocus(Object param)
          Called when the focus is given to the editor
 boolean readValue(Object parameter)
           
 void setAutoUpdate(boolean autoUpdate)
          Sets the auto-update property of the view.
 void setEmbedded(boolean isEmbedded)
          Sets wether the editor is embedded in a view.
 void setEnabled(boolean enabled)
           
 void setField(FieldItem field)
          Sets the field being displayed
 void setSubstance(Object substance)
          Sets the substance object holding the field
 void setValue(Object value)
          Sets the value to display
 
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.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
 

Field Detail

substance

protected Object substance

field

protected FieldItem field

setter

protected MethodItem setter

value

protected Object value

isEmbedded

protected boolean isEmbedded
Constructor Detail

AbstractFieldEditor

public AbstractFieldEditor(Object substance,
                           FieldItem field)
Method Detail

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

setValue

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

Specified by:
setValue in interface FieldView
Parameters:
value - the value

setSubstance

public void setSubstance(Object substance)
Description copied from interface: FieldView
Sets the substance object holding the field

Specified by:
setSubstance in interface FieldView
Parameters:
substance - the substance

setField

public void setField(FieldItem field)
Description copied from interface: FieldView
Sets the field being displayed

Specified by:
setField in interface FieldView
Parameters:
field - the field

getField

public FieldItem getField()
Specified by:
getField in interface FieldView
Returns:
the field item

setAutoUpdate

public void setAutoUpdate(boolean autoUpdate)
Description copied from interface: FieldView
Sets the auto-update property of the view. If auto-update is true (which is the default), the view registers for changes on field it displays.

Specified by:
setAutoUpdate in interface FieldView

setEmbedded

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

Specified by:
setEmbedded in interface FieldEditor

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

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

readValue

public boolean readValue(Object parameter)

doReadValue

protected abstract boolean doReadValue(Object parameter)

commit

public void commit()
Commit editing by calling the setter method.

Specified by:
commit in interface FieldEditor

fieldUpdated

public void fieldUpdated(Object substance,
                         FieldItem field,
                         Object value,
                         Object param)
Description copied from interface: FieldUpdate
Upcalled when a field was modified.

Specified by:
fieldUpdated in interface FieldUpdate
Parameters:
substance - the object of which a field was updated
field - the updated field
value - new value of the vield
param - extra infos (unused)
See Also:
ViewControlWrapper.registerField(Wrappee,FieldItem,FieldUpdate,Object)

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface FieldEditor

setEnabled

public void setEnabled(boolean enabled)
Specified by:
setEnabled in interface FieldEditor

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli