Interface ComponentBuilderCallBack


  • public interface ComponentBuilderCallBack

    An interface for describing call back operations that can be registered at the central builder data object.

    Constructing a user GUI and an accompaning Form object is a complex and non linear process. For instance it can happen that a component is created that must be connected to another component, which has not yet been created (e.g. a label that is associated with another GUI widget). Such references cannot savely be resolved before the building process has finished.

    This interface provides a solution to the mentioned problem. It allows interested objects to register themselves as call backs at the builder data object. These call backs are executed when the building process ends. At this time all GUI components have been created and are accessable through the builder data object. So the registered objects should be able to resolve all valid references to components created during the building operation.

    But implementations of this interface are not limited to resolving references. They can perform arbitrary actions that need to be executed after the building process has been completed.

    Version:
    $Id: ComponentBuilderCallBack.java 205 2012-01-29 18:29:57Z oheger $
    Author:
    Oliver Heger
    • Method Detail

      • callBack

        void callBack​(ComponentBuilderData builderData,
                      Object params)
               throws FormBuilderException
        Executes the call back. In this method implementing classes can pack arbitrary logic that should be executed after the building process has been completed. The passed in parameters can be used to access all information gathered at the building process. If an implementation throws an exception, this exception is passed through to the caller of the building operation.
        Parameters:
        builderData - the builder data object of the current building process
        params - an arbitrary parameter object that has been registered with the call back object
        Throws:
        FormBuilderException - an implementation can throw this exception to indicate that the building process should fail