com.partnersoft.v3x.gadgets
Class RecordEditor

java.lang.Object
  extended by com.partnersoft.v3x.gadgets.EditorGadget
      extended by com.partnersoft.v3x.gadgets.RecordEditor
All Implemented Interfaces:
Editor
Direct Known Subclasses:
CascadingEditor

public class RecordEditor
extends EditorGadget

An editor for objects that uses gets and sets properties using the Record interface. If the edited object does not implement Record, the BeanRecord wrapper class is used instead.


Constructor Summary
RecordEditor()
          Construct a new editor.
 
Method Summary
 void addSpecifier(java.lang.String fieldName, Specifier specifier)
          Add a specifier for a field.
 void addViewer(java.lang.String fieldName, Viewer viewer)
          Add a viewer for a field.
 void applyChanges(java.util.Map dict)
          Uses the dictionary to make changes to the working copy of the record.
 void autosaveOn(java.lang.String propertyName)
          Autosaves for the given property.
 void forceSave()
          Save changes to the object no matter what.
 java.util.Map getCurrentSpecifiedValues()
           
 java.lang.Object getEdited()
          Get the object being edited.
 boolean isAutosaving()
          Autosaves for any change to any specifier.
 boolean isForcedSaving()
           
 java.util.List<Specifier> listSpecifiersFor(java.lang.String fieldName)
          Get a specifier for a field.
 java.util.List<Viewer> listViewersFor(java.lang.String fieldName)
          Get a viewer for a field.
 void reset()
          Reset the editor to reflect the state of the object the last time it was saved.
 void save()
          Save changes to the object if there are any.
 void setAutosaving(boolean tizit)
           
 void setEdited(java.lang.Object newVictim)
          Set the object to be edited.
 void setForcedSaving(boolean tizit)
           
 
Methods inherited from class com.partnersoft.v3x.gadgets.EditorGadget
addEditListener, delete, fireChanged, removeEditListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordEditor

public RecordEditor()
Construct a new editor. No fields will be managed.

Method Detail

addSpecifier

public void addSpecifier(java.lang.String fieldName,
                         Specifier specifier)
Add a specifier for a field.


addViewer

public void addViewer(java.lang.String fieldName,
                      Viewer viewer)
Add a viewer for a field.


listSpecifiersFor

public java.util.List<Specifier> listSpecifiersFor(java.lang.String fieldName)
Get a specifier for a field.


listViewersFor

public java.util.List<Viewer> listViewersFor(java.lang.String fieldName)
Get a viewer for a field.


save

public void save()
Save changes to the object if there are any.

Specified by:
save in interface Editor
Overrides:
save in class EditorGadget

forceSave

public void forceSave()
Save changes to the object no matter what.


getCurrentSpecifiedValues

public java.util.Map getCurrentSpecifiedValues()

reset

public void reset()
Reset the editor to reflect the state of the object the last time it was saved.


applyChanges

public void applyChanges(java.util.Map dict)
Uses the dictionary to make changes to the working copy of the record. Ignores null fields.


isForcedSaving

public boolean isForcedSaving()

setForcedSaving

public void setForcedSaving(boolean tizit)

setEdited

public void setEdited(java.lang.Object newVictim)
Set the object to be edited.

Specified by:
setEdited in interface Editor
Overrides:
setEdited in class EditorGadget

getEdited

public java.lang.Object getEdited()
Get the object being edited.


isAutosaving

public boolean isAutosaving()
Autosaves for any change to any specifier.


setAutosaving

public void setAutosaving(boolean tizit)

autosaveOn

public void autosaveOn(java.lang.String propertyName)
Autosaves for the given property.