com.sage.swt.client.ui.builder
Class MasterBuilder

java.lang.Object
  extended by com.sage.swt.client.ui.builder.MasterBuilder

public final class MasterBuilder
extends java.lang.Object

Master builder for a SWT UI written in GWT. The master builder starts up a UI, using the given engine factories and feature modules to help build that UI. When UI startup completes, the master builder uses a callback (if supplied) to notify the caller.

This "base" master builder requires engine factories to be passed in via setters. It does not include any default feature modules either - feature modules can be added via an adder.


Constructor Summary
MasterBuilder()
          Constructs a "bare-bones" SWT UI master builder.
 
Method Summary
 void addActionFactory(SwtActionFactory actionFactory)
          Adds a SwtActionFactory to the factories that will be used by the UI for generating actions that will be bound to events in the UI.
 void addFeatureModule(FeatureModule featureModule)
          Adds a feature module that this builder will use to build the UI.
 void setActionsEngineFactory(ActionsEngineFactory actionsEngineFactory)
          Sets the actions engine factory that this builder will use.
 void setCommunicationEngineFactory(CommunicationEngineFactory communicationEngineFactory)
          Sets the communication engine factory that this builder will use.
 void setDataEngineFactory(DataEngineFactory dataEngineFactory)
          Sets the data engine factory that this builder will use.
 void setErrorDisplayer(SwtErrorDisplayer errorDisplayer)
          Sets the SWT error displayer that will be used to store and display errors.
 void setLoadingSpinner(SpinnerProgressControl loadingSpinner)
          Set loading spinner
 void setPreferenceStoreEngineFactory(PreferenceStoreEngineFactory preferenceStoreEngineFactory)
          Sets the preference store engine factory that this builder will use.
 void setPropertyResolutionManagerFactory(PropertyResolutionManagerFactory propertyResolutionManagerFactory)
          Sets the property resolution manager factory that this builder will use.
 void setWidgetsEngineFactory(WidgetsEngineFactory widgetsEngineFactory)
          Sets the widgets engine factory that this builder will use.
 void startUI(java.lang.String portletCommunicationID, boolean isPortal, java.lang.String webHelpPath, java.lang.String sessionID, java.lang.String contractPath, java.lang.String uiDefinitionVersion, java.lang.String uiDefinitionCategory, java.lang.String uiDefinitionName, java.lang.String portletObjectID, MasterBuilderCallback callback)
          Starts the build (and startup sequence) of the specified UI, using the engines factories and feature modules that the application has specified in the various setters and adders.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterBuilder

public MasterBuilder()
Constructs a "bare-bones" SWT UI master builder. Callers must use the appropriate setters to set those engine factories and must add feature modules before building and starting up the UI.

Method Detail

setCommunicationEngineFactory

public void setCommunicationEngineFactory(CommunicationEngineFactory communicationEngineFactory)
Sets the communication engine factory that this builder will use. The engine factory must be set before this builder can build and start up the UI.

Parameters:
communicationEngineFactory - The communication engine factory that this builder will use.

setDataEngineFactory

public void setDataEngineFactory(DataEngineFactory dataEngineFactory)
Sets the data engine factory that this builder will use. The engine factory must be set before this builder can build and start up the UI.

Parameters:
dataEngineFactory - The data engine factory that this builder will use.

setPreferenceStoreEngineFactory

public void setPreferenceStoreEngineFactory(PreferenceStoreEngineFactory preferenceStoreEngineFactory)
Sets the preference store engine factory that this builder will use. The engine factory must be set before this builder can build and start up the UI.

Parameters:
preferenceStoreEngineFactory - The preferenceStore engine factory that this builder will use.

setLoadingSpinner

public void setLoadingSpinner(SpinnerProgressControl loadingSpinner)
Set loading spinner

Parameters:
loadingSpinner - Spinner that display during UI loading

setWidgetsEngineFactory

public void setWidgetsEngineFactory(WidgetsEngineFactory widgetsEngineFactory)
Sets the widgets engine factory that this builder will use. The engine factory must be set before this builder can build and start up the UI.

Parameters:
widgetsEngineFactory - The widgets engine factory that this builder will use.

setActionsEngineFactory

public void setActionsEngineFactory(ActionsEngineFactory actionsEngineFactory)
Sets the actions engine factory that this builder will use. The engine factory must be set before this builder can build and start up the UI.

Parameters:
actionsEngineFactory - The actions engine factory that this builder will use.

setPropertyResolutionManagerFactory

public void setPropertyResolutionManagerFactory(PropertyResolutionManagerFactory propertyResolutionManagerFactory)
Sets the property resolution manager factory that this builder will use. The manager factory must be set before this builder can build and start up the UI.

Parameters:
propertyResolutionManagerFactory - The property resolution manager factory that this builder will use.

addActionFactory

public void addActionFactory(SwtActionFactory actionFactory)
Adds a SwtActionFactory to the factories that will be used by the UI for generating actions that will be bound to events in the UI.

Parameters:
actionFactory - A SwtActionFactory that will be used by the UI for generating actions that will be bound to events in the UI.

setErrorDisplayer

public void setErrorDisplayer(SwtErrorDisplayer errorDisplayer)
Sets the SWT error displayer that will be used to store and display errors.

Parameters:
errorDisplayer - The SWT error displayer that will be used to store and display errors.

addFeatureModule

public void addFeatureModule(FeatureModule featureModule)
Adds a feature module that this builder will use to build the UI. Feature modules are invoked in the order they are added. Feature modules must be added before this builder builds and starts up the UI.

Parameters:
featureModule - A feature module that this builder will use to build the UI. (Null feature modules and duplicate instances of the same feature module are ignored.)

startUI

public void startUI(java.lang.String portletCommunicationID,
                    boolean isPortal,
                    java.lang.String webHelpPath,
                    java.lang.String sessionID,
                    java.lang.String contractPath,
                    java.lang.String uiDefinitionVersion,
                    java.lang.String uiDefinitionCategory,
                    java.lang.String uiDefinitionName,
                    java.lang.String portletObjectID,
                    MasterBuilderCallback callback)
Starts the build (and startup sequence) of the specified UI, using the engines factories and feature modules that the application has specified in the various setters and adders.

Parameters:
portletCommunicationID - The portlet communication ID of the UI to build.
isPortal - Whether or not this instance is the Portal application.
webHelpPath - The base URL path of the Web Help for this application. This will be used by help widgets on this UI to construct the full path to the web help topic - by combining the base path with the path to the topic specified in the HelpID property of the help widget.
sessionID - The session ID for the instance.
contractPath - The contract portion of the SData path used to get UI definitions. For example, it might be "SDataServlet/.../UIDefinitions" (no path separator at the end).
uiDefinitionVersion - The version that the declarative UI definition belongs to (for example, "ar60a").
uiDefinitionCategory - The category that the declarative UI definition belongs to (for example, "agedReceivables").
uiDefinitionName - The name of the declarative UI definition, which is the file name without the "xml" extension (for example, "ARATBUIDefinition").
portletObjectID - The portlet object ID of the UI to build. This object ID is used for differentiating between multiple instances of a snapshot UI hosted by URL portlets on the portal's landing page, so that each instance can persist different preference values (such as configuration settings). Note the portal itself (and its child landing page) and UIs running standalone (in other words, not hosted within URL portlets) have no portlet object IDs.
callback - An optional callback that lets the master builder notify the caller when the UI build is done or when it encounters an error that prevents it from finishing that UI build.
Throws:
java.lang.IllegalStateException - The required engine factories and error displayer aren't set, or the error displayer has null components.


Copyright © 2011 Sage Software, Inc. All rights reserved.