Class ScreenLoader

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers, HasMembersChangedHandlers

public class ScreenLoader extends VLayout
The ScreenLoader component can be used to load ComponentXML Screens into a running application.

A ScreenLoader is a VLayout, and can be provided anywhere a Canvas can be used: as a Tab pane, and Layout member, etc. When a ScreenLoader draws, it shows a loading message if enabled, performs an RPC to the screenLoaderURL to load the screen, if necessary, and finally embeds the screen within the layout.

The last top-level UI component (Canvas subclass) defined by the screen is set as the layout contents. Top-level in this case means that the UI component is not contained in another UI component as a member or child.

The ScreenLoader relies on the XMLHttpRequest object which can be disabled by end-users in some supported browsers. See PlatformDependencies for more information.

  • Constructor Details

    • ScreenLoader

      public ScreenLoader()
    • ScreenLoader

      public ScreenLoader(JavaScriptObject jsObj)
  • Method Details

    • getOrCreateRef

      public static ScreenLoader getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class VLayout
    • setDataContextBinding

      public ScreenLoader setDataContextBinding(DataContextBinding dataContextBinding)
      A DataContextBinding to be applied to the loaded screen via Canvas.setDataContext().

      If this method is called after the component has been drawn/initialized: Set the dataContextBinding property.
      Parameters:
      dataContextBinding - the new DataContext binding. Default value is null
      Returns:
      ScreenLoader instance, for chaining setter calls
    • getDataContextBinding

      public DataContextBinding getDataContextBinding()
      A DataContextBinding to be applied to the loaded screen via Canvas.setDataContext().
      Returns:
      Current dataContextBinding value. Default value is null
    • setEditProxyConstructor

      public ScreenLoader setEditProxyConstructor(String editProxyConstructor) throws IllegalStateException
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      setEditProxyConstructor in class Layout
      Parameters:
      editProxyConstructor - New editProxyConstructor value. Default value is "ScreenLoaderEditProxy"
      Returns:
      ScreenLoader instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getEditProxyConstructor

      public String getEditProxyConstructor()
      Default class used to construct the EditProxy for this component when the component is first placed into edit mode.
      Overrides:
      getEditProxyConstructor in class Layout
      Returns:
      Current editProxyConstructor value. Default value is "ScreenLoaderEditProxy"
      See Also:
    • setLoadingMessage

      public ScreenLoader setLoadingMessage(String loadingMessage) throws IllegalStateException
      Message to show while the screen is loading if enabled. Use "${loadingImage}" to include a loading image.
      Parameters:
      loadingMessage - New loadingMessage value. Default value is "Loading Screen... ${loadingImage}"
      Returns:
      ScreenLoader instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getLoadingMessage

      public String getLoadingMessage()
      Message to show while the screen is loading if enabled. Use "${loadingImage}" to include a loading image.
      Returns:
      Current loadingMessage value. Default value is "Loading Screen... ${loadingImage}"
      See Also:
    • setScreenLoaderURL

      public ScreenLoader setScreenLoaderURL(String screenLoaderURL) throws IllegalStateException
      Specifies the URL where ScreenLoaderServlet is installed. If not set, screenLoaderURL is used.
      Parameters:
      screenLoaderURL - New screenLoaderURL value. Default value is null
      Returns:
      ScreenLoader instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getScreenLoaderURL

      public String getScreenLoaderURL()
      Specifies the URL where ScreenLoaderServlet is installed. If not set, screenLoaderURL is used.
      Returns:
      Current screenLoaderURL value. Default value is null
      See Also:
    • setScreenName

      public ScreenLoader setScreenName(String screenName) throws IllegalStateException
      Name of screen to be loaded.
      Parameters:
      screenName - New screenName value. Default value is null
      Returns:
      ScreenLoader instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getScreenName

      public String getScreenName()
      Name of screen to be loaded.
      Returns:
      Current screenName value. Default value is null
    • setShowLoadingMessage

      public ScreenLoader setShowLoadingMessage(Boolean showLoadingMessage) throws IllegalStateException
      Should a loading message be displayed while screen is loading?
      Parameters:
      showLoadingMessage - New showLoadingMessage value. Default value is false
      Returns:
      ScreenLoader instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowLoadingMessage

      public Boolean getShowLoadingMessage()
      Should a loading message be displayed while screen is loading?
      Returns:
      Current showLoadingMessage value. Default value is false
    • dataContextChanged

      public void dataContextChanged()
      Notification method fired when DataContext is bound on the embedded screen. This can occur on the initial draw or by an explicit call to setDataContext() either via this ScreenLoader or from other components including the screen itself.
      Overrides:
      dataContextChanged in class Canvas
    • setDefaultProperties

      public static void setDefaultProperties(ScreenLoader screenLoaderProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      screenLoaderProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(ScreenLoaderLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class VLayout