public interface WebPluginGadgetFactory<G extends GomElement,C extends Serializable> extends de.espirit.firstspirit.module.GadgetComponent.GadgetFactory<WebPluginGadget<C>,G,GadgetContext<G>>
Modifier and Type | Method and Description |
---|---|
WebPluginGadget<C> |
create(GadgetContext<G> context)
Creates a specific pluggable gadget.
|
String |
getControllerName()
Provides the name of the javascript controller constructor for this gadget, which should be defined as window property (e.g. window.ControllerConstructor = ...).
|
List<String> |
getScriptUrls()
Provides a list of relative or absolute javascript urls for this webedit gadget.
|
List<String> |
getStylesheetUrls()
Provides a list of relative or absolute stylesheet/css urls for this webedit gadget.
|
@NotNull WebPluginGadget<C> create(@NotNull GadgetContext<G> context)
create
in interface de.espirit.firstspirit.module.GadgetComponent.GadgetFactory<WebPluginGadget<C extends Serializable>,G extends GomElement,GadgetContext<G extends GomElement>>
@NotNull String getControllerName()
Two parameters are given to the constructor:
WebPluginGadgetHost
providing means to access the elements defined in the view and to communicate to the gadget containing framework.C
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;
};
};
WebPluginGadgetHost
@NotNull List<String> getScriptUrls()
for the definition of the gadget controller code
@NotNull List<String> getStylesheetUrls()
Copyright © 2015 e-Spirit AG. All Rights Reserved. Build 5.1.408