org.sandev.basics.util
Interface UIFormManager

All Known Implementing Classes:
AbstractFormManager, RootedFormManager, StandardFormManager

public interface UIFormManager

Handles the processing of a UIFormContext. A UI adaptor node will typically:

  1. get the UIFormContext from the user input information using a UIFormAdaptor
  2. call a UIFormManager to process the UIFormContext

Typically the UI adaptor will implement UIFormOwner and pass itself in to support the UIFormManager processing. See the documentation of each UIFormManager for details on what is required.


Method Summary
 void disableUnsupportedActions(UIFormContext uifc)
          Turn off actions that are not supported in the current mode.
 void initFormAdaptor(UIFormAdaptor adaptor)
          Initialize the given form adaptor as needed.
 boolean processForm(UIFormContext uifc, UIFormOwner owner)
          Process the UIFormContext, modifying it as necessary to react to the user action.
 

Method Detail

initFormAdaptor

void initFormAdaptor(UIFormAdaptor adaptor)
                     throws UIFormManagerException
Initialize the given form adaptor as needed.

Throws:
UIFormManagerException

processForm

boolean processForm(UIFormContext uifc,
                    UIFormOwner owner)
                    throws UIFormManagerException
Process the UIFormContext, modifying it as necessary to react to the user action. Return true if global data has changed (usually in response to UIFormContext.ACTION_SAVE), otherwise return false. Throw an exception if a processing error occurs.

This method assumes that the UIFormContext is ready for processing, either having been properly initialized by the caller, or reconstructed by the UIFormAdaptor.

Implementors must immediately call UIFormOwner.trackFormProcessCall before doing any other work. This allows the owner to handle any debugging, monitoring, setup or other operations required.

Throws:
UIFormManagerException

disableUnsupportedActions

void disableUnsupportedActions(UIFormContext uifc)
Turn off actions that are not supported in the current mode. In the event of a form load error, a UI may choose not to process the form. In this case they will need to call this method to disable top level actions.