ilog.views.faces.dhtml.renderkit
Class IlvScriptDescriptor

java.lang.Object
  extended by ilog.views.faces.dhtml.renderkit.IlvScriptDescriptor

public abstract class IlvScriptDescriptor
extends Object

The script descriptor class is associated with a type of DHTML components and defines the scripts that are needed by this component in order to work properly. This descriptor is used by the manager that prevents script duplication and by the renderer that produces the declaration of these scripts in the right place.

Since:
JViews 6.0

Constructor Summary
IlvScriptDescriptor(String id)
          Builds a new instance of a Script descriptor.
IlvScriptDescriptor(String id, IlvScriptDescriptor superDescriptor)
          Builds a new instance of a Script descriptor.
 
Method Summary
 void addJSCodeAfterImport(IlvScriptManager scriptManager, ResponseWriter writer)
          Renders optional static JavaScript code to customize the imported scripts.
 void addJSCodeBeforeImport(IlvScriptManager scriptManager, ResponseWriter writer)
          Renders optional static JavaScript code to customize the imported scripts.
abstract  void addScriptsToLoad(IlvScriptManager scriptManager, Writer writer)
          Adds the scripts needed by the associated component.
protected  void endScriptSection(Writer writer)
          Renders to the writer the ending of a script section.
 String getContextPath()
           
 String getId()
          Returns the ID of the renderer associated with this script descriptor.
 String getJSResource(String file)
          Returns the URL of a JavaScript resource using the resource servlet.
 String getJSResource(String directory, String file)
          Returns the URL of a JavaScript resource using the resource servlet.
 String getResource(String directory, String file, String type)
          Returns the URL of the resource using the resource servlet.
protected  void startScriptSection(Writer writer)
          Renders to the writer the starting of a script section.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvScriptDescriptor

public IlvScriptDescriptor(String id)
Builds a new instance of a Script descriptor. The ID passed as a parameter must be unique for each renderer class.

Parameters:
id - The ID of the class.

IlvScriptDescriptor

public IlvScriptDescriptor(String id,
                           IlvScriptDescriptor superDescriptor)
Builds a new instance of a Script descriptor. The ID passed as a parameter must be unique for each renderer class.

Parameters:
id - The identifier of the renderer.
superDescriptor - The super class descriptor.
Method Detail

getId

public String getId()
Returns the ID of the renderer associated with this script descriptor.

Returns:
The ID of the renderer associated with this script descriptor.

addScriptsToLoad

public abstract void addScriptsToLoad(IlvScriptManager scriptManager,
                                      Writer writer)
Adds the scripts needed by the associated component. Each component must overload this method and use the IlvScriptManager.addScript(Writer, String) method to add a script to import.

Parameters:
scriptManager - The script manager.
writer - The writer into which to write.

addJSCodeBeforeImport

public void addJSCodeBeforeImport(IlvScriptManager scriptManager,
                                  ResponseWriter writer)
Renders optional static JavaScript code to customize the imported scripts.

This code is rendered after the scripts declaration.

This default implementation does nothing.

Parameters:
scriptManager - The script manager
writer - The response writer.
Since:
JViews 8.1

addJSCodeAfterImport

public void addJSCodeAfterImport(IlvScriptManager scriptManager,
                                 ResponseWriter writer)
Renders optional static JavaScript code to customize the imported scripts.

This code is rendered after the scripts declaration.

This default implementation does nothing.

Parameters:
scriptManager - The script manager
writer - The response writer.
Since:
JViews 8.1

getJSResource

public String getJSResource(String file)
Returns the URL of a JavaScript resource using the resource servlet.

Parameters:
file - The name of the resource to load.
Returns:
The URL of the JavaScript resource using the resource servlet.

getJSResource

public String getJSResource(String directory,
                            String file)
Returns the URL of a JavaScript resource using the resource servlet.

Parameters:
directory - The subdirectory where the resource is located.
file - The name of the resource to load.
Returns:
The URL of the JavaScript resource using the resource servlet.

getResource

public String getResource(String directory,
                          String file,
                          String type)
Returns the URL of the resource using the resource servlet.

Parameters:
directory - The subdirectory where the resource is located.
file - The name of the resource to load.
type - The HTML type of the resource to load.
Returns:
The URL of the resource using the resource servlet.

getContextPath

public String getContextPath()
Internal method or field: do not use!

startScriptSection

protected void startScriptSection(Writer writer)
                           throws IOException
Renders to the writer the starting of a script section.

Parameters:
writer - The writer
Throws:
IOException
Since:
JViews 7.5
See Also:
IlvDHTMLUtil.startScriptSection(Writer)

endScriptSection

protected void endScriptSection(Writer writer)
                         throws IOException
Renders to the writer the ending of a script section.

Parameters:
writer - The writer
Throws:
IOException
Since:
JViews 7.5
See Also:
IlvDHTMLUtil.endScriptSection(Writer)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.