Class MolPaintJSRenderer
java.lang.Object
jakarta.faces.render.Renderer
de.ipb_halle.molecularfaces.component.molplugin.MolPluginRenderer
de.ipb_halle.molecularfaces.component.molplugin.MolPaintJSRenderer
This
Renderer renders a chemical structure editor or viewer using the
MolPaintJS Javascript
plugin.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringName of the JavaScript global variable that represents a common ResourcesLoader instance for all rendered components of this plugin type.static final StringFields inherited from class jakarta.faces.render.Renderer
PASSTHROUGH_RENDERER_LOCALNAME_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidencodeBegin(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component) private voidencodeEditor(jakarta.faces.context.FacesContext context, jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin) private voidencodeEditorHTML(jakarta.faces.context.FacesContext context, jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin, String divId, String hiddenInputId) Encodes the HTML part of the plugin editor into the writer.private voidencodeEditorJS(jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin, String divId, String hiddenInputId) Encodes the Javascript part of the plugin editor into the writer.private voidencodeViewer(jakarta.faces.context.FacesContext context, jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin) private voidencodeViewerHTML(jakarta.faces.context.FacesContext context, jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin, String divId, String hiddenInputId) Encodes the HTML part of the plugin viewer into the writer.private voidencodeViewerJS(jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin, String divId, String hiddenInputId) Encodes the Javascript part of the plugin viewer into the writer.Methods inherited from class de.ipb_halle.molecularfaces.component.molplugin.MolPluginRenderer
decode, generateDivStyle, getConvertedValueMethods inherited from class jakarta.faces.render.Renderer
convertClientId, encodeChildren, encodeEnd, getRendersChildren
-
Field Details
-
RENDERER_TYPE
- See Also:
-
loaderJSVar
Name of the JavaScript global variable that represents a common ResourcesLoader instance for all rendered components of this plugin type. This variable is defined in MolecularFaces.js.
-
-
Constructor Details
-
MolPaintJSRenderer
public MolPaintJSRenderer()
-
-
Method Details
-
encodeBegin
public void encodeBegin(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component) throws IOException - Overrides:
encodeBeginin classjakarta.faces.render.Renderer- Throws:
IOException
-
encodeViewer
private void encodeViewer(jakarta.faces.context.FacesContext context, jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin) throws IOException - Throws:
IOException
-
encodeViewerHTML
private void encodeViewerHTML(jakarta.faces.context.FacesContext context, jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin, String divId, String hiddenInputId) throws IOException Encodes the HTML part of the plugin viewer into the writer. It consists of a <div> element that the Javascript plugin uses as rendering target.- Parameters:
context-writer-plugin-divId- DOM id of the embedded <div> elementhiddenInputId- DOM id of the embedded hidden <input> element- Throws:
IOException
-
encodeViewerJS
private void encodeViewerJS(jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin, String divId, String hiddenInputId) throws IOException Encodes the Javascript part of the plugin viewer into the writer.- Parameters:
writer-plugin-divId- DOM id of the <div> elementhiddenInputId- DOM id of the embedded hidden <input> element- Throws:
IOException
-
encodeEditor
private void encodeEditor(jakarta.faces.context.FacesContext context, jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin) throws IOException - Throws:
IOException
-
encodeEditorHTML
private void encodeEditorHTML(jakarta.faces.context.FacesContext context, jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin, String divId, String hiddenInputId) throws IOException Encodes the HTML part of the plugin editor into the writer. It consists of a <div> and a hidden <input> element.- Parameters:
context-writer-plugin-divId- DOM id of the embedded <div> elementhiddenInputId- DOM id of the embedded hidden <input> element- Throws:
IOException
-
encodeEditorJS
private void encodeEditorJS(jakarta.faces.context.ResponseWriter writer, MolPluginCore plugin, String divId, String hiddenInputId) throws IOException Encodes the Javascript part of the plugin editor into the writer.Note: Different components of this plugin type will use one and the same Javascript variable, which will be overwritten in case it already exists.
- Parameters:
writer-plugin-divId- DOM id of the <div> elementhiddenInputId- DOM id of the hidden <input> element- Throws:
IOException
-