Interface WebPluginGadgetFactory<G extends GomElement,C extends Serializable>

All Superinterfaces:
GadgetFactory<WebPluginGadget<C>,G,GadgetContext<G>>

public interface WebPluginGadgetFactory<G extends GomElement,C extends Serializable> extends GadgetFactory<WebPluginGadget<C>,G,GadgetContext<G>>
Definition for factories producing custom client-side gadgets using web-technologies (i.e., HTML, JavaScript, and CSS).
Since:
5.1.25
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull WebPluginGadget<C>
    create(@NotNull GadgetContext<G> context)
    Creates a specific pluggable gadget.
    @NotNull String
    Provides the name of the javascript controller constructor for this gadget, which should be defined as window property (e.g. window.ControllerConstructor = ...).
    @NotNull List<String>
    Provides a list of relative or absolute javascript urls for this webedit gadget.
    @NotNull List<String>
    Provides a list of relative or absolute stylesheet/css urls for this webedit gadget.
  • Method Details

    • create

      @NotNull @NotNull WebPluginGadget<C> create(@NotNull @NotNull GadgetContext<G> context)
      Creates a specific pluggable gadget.
      Specified by:
      create in interface GadgetFactory<WebPluginGadget<C extends Serializable>,G extends GomElement,GadgetContext<G extends GomElement>>
      Parameters:
      context - The context information.
      Returns:
      The gadget.
      Since:
      5.1.25
    • getControllerName

      @NotNull @NotNull String getControllerName()
      Provides the name of the javascript controller constructor for this gadget, which should be defined as window property (e.g. window.ControllerConstructor = ...).

      Two parameters are given to the constructor:

      • a WebPluginGadgetHost providing means to access the elements defined in the view and to communicate to the gadget containing framework.
      • a configuration object as given by the server-side implementation of the web gadget (corresponding to type WebPluginGadgetFactory as defined in this factory implementation).

      Simple example for the related controller object including the aspects ValueHolder, Labelable, and Editable, operating on an HTML field having the id "text":

      
       window.ControllerConstructor = function(webHost, configuration) {
           this.webHost = webHost;
           this.configuration = configuration;
           function getField() {
               return webHost.getElementById("text");
           }
           // ValueHolder
           this.getValue = function() {
               return getField().value;
           };
           this.setValue = function(value) {
               getField().value = value;
           };
           this.isEmpty = function() {
               return getField().value;
           };
           // Labelable
           this.getLabel = function() {
               return this.configuration.label;
           };
           // Editable
           this.setEditable = function(enable) {
               getField().disabled = !enable;
           };
       };
       
       
      Returns:
      The name of the javascript controller
      Since:
      5.1.25
      See Also:
    • getScriptUrls

      @NotNull @NotNull List<String> getScriptUrls()
      Provides a list of relative or absolute javascript urls for this webedit gadget. The baseurl for the relative urls is the webedit webapp context path (e.g. /fs5webedit/).
      Returns:
      a list of javascript urls which should be loaded for this gadget
      Since:
      5.1.25
      See Also:
    • getStylesheetUrls

      @NotNull @NotNull List<String> getStylesheetUrls()
      Provides a list of relative or absolute stylesheet/css urls for this webedit gadget. The baseurl for the relative urls is the webedit webapp context path (e.g. /fs5webedit/).
      Returns:
      a list of stylesheet/css urls which should be loaded for this gadget
      Since:
      5.1.25