/********************************************************************
 *  Oracle JDeveloper
 *  Copyright (c) 1997, 1999, Oracle Corporation. All rights reserved.
 ********************************************************************/


package oracle.jdeveloper.html;

import java.io.PrintWriter;

/**
 * Represents a JavaScript function that is to be added to a script. 
 *
 * @author  Juan Oropeza
 * @version PUBLIC
 *
 **/

public class HTMLScriptFunction extends HTMLElementContainer
{

   protected   String Description;
   protected   String Source;
   
   /**
   *	@param Description	A comment tobe added in front of the function
   *	@param Source		The function's source code.
   */
   public HTMLScriptFunction(String Description, String Source)
   {
      this.Description = Description;
      this.Source = Source;
   }

   /**
   *	@param Description	A comment tobe added in front of the function
   */   
   public void setDescription(String sDescription)
   {
	   this.Description = sDescription;
   }

   /*
	*	@param Source		The function's source code.
   */
   public void setSource(String source)
   {
      Source = source;
   }
   
   public void render(PrintWriter out)
   {
      out.println("//" + Description);
      if(Source != null)
         out.print(Source);
      out.println("//--------------------------------------");
   }
}