org.sandev.tools.ConfigEditor
Class FormManager

java.lang.Object
  extended byorg.sandev.basics.util.AbstractFormManager
      extended byorg.sandev.basics.util.RootedFormManager
          extended byorg.sandev.tools.ConfigEditor.FormManager
All Implemented Interfaces:
org.sandev.basics.util.UIFormManager

public class FormManager
extends org.sandev.basics.util.RootedFormManager
implements org.sandev.basics.util.UIFormManager

A UIFormManager implementation to handle the unique needs of the config editor. This class extends RootedFormManager.

The config editor is a bit of an exceptional case, since it is a non-persistent object that directly contains references to persistent objects. Some of these contained objects may in turn reference other persistent objects, and that's where things get a bit weird.

The config editor is a plain object editor, which edits everything in place, using the serialized configuration as it's sole reference. Most plain object editors don't have to deal with dereferencing persistent objects since they are self contained. Config editor can dereference by looking things up in it's own initial data, but it needs to keep the rootMsg of the UIFormContext set to the Configuration, or it will lose its state.

However, not supporting deref is pretty lame. So what we do is essentially equate deref to a move operation. When a user clicks to dereference, we move to that position in the initialData.


Field Summary
 
Fields inherited from class org.sandev.basics.util.RootedFormManager
BADREF_PREFIX, BRANCH_DISALLOWED, FIX_BADREFS_BEFORE_SAVE, REF_VALIDATION_FAILURE
 
Fields inherited from class org.sandev.basics.util.AbstractFormManager
CLASS_DISAMBIGUATION_PROMPT, FIX_FIELDS_BEFORE_SAVE, INVALID_FIELD_VALUE_PREFIX, RC_CANCELLED, RC_DONE, RC_QUERYING, uifa
 
Constructor Summary
FormManager()
           
 
Method Summary
protected  void doActionDeref(org.sandev.basics.util.UIFormContext uifc, org.sandev.basics.util.UIFormOwner owner)
          Translate the dereference into a move operation.
 
Methods inherited from class org.sandev.basics.util.RootedFormManager
getBadReferenceFailureText, getBadReferencePrefix, getBranchDisallowedText, getReferenceValidationFailure, mergeChangesToParentBeforeAdd, resolveReferences, supportsTopLevelAdd, supportsTopLevelFind, trackUpdates
 
Methods inherited from class org.sandev.basics.util.AbstractFormManager
disableUnsupportedActions, doActionAdd, doActionCancel, doActionDelete, doActionDrilldown, doActionEdit, doActionFind, doActionHelp, doActionMove, doActionNew, doActionNext, doActionOk, doActionParent, doActionPrevious, doActionRemove, doActionSave, doActionSelect, fieldValidateCurrentInstance, getClassDisambiguationPrompt, getFieldValidationFailureText, getInvalidFieldMessagePrefix, initFormAdaptor, okContainedAdd, okNewReference, okTopLevelAdd, okUpdate, outstandingChangesExist, processForm, processUpdate, resolveClass, trace, wrappedGenAdd, wrappedGenMod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.sandev.basics.util.UIFormManager
disableUnsupportedActions, initFormAdaptor, processForm
 

Constructor Detail

FormManager

public FormManager()
Method Detail

doActionDeref

protected void doActionDeref(org.sandev.basics.util.UIFormContext uifc,
                             org.sandev.basics.util.UIFormOwner owner)
                      throws org.sandev.basics.util.UIFormManagerException
Translate the dereference into a move operation. We can't change the rootMsg or we lose our editing state but we can move around, and the reference must be contained in the rootMsg somewhere.

If this is a persistent message, then it will be found somewhere in the initialData. Otherwise this is a server name reference and we look it up by name there.

Throws:
org.sandev.basics.util.UIFormManagerException