/*
 * @(#)PasswordField.java
 *
 * Copyright 2001-2002 by Oracle Corporation,
 * 500 Oracle Parkway, Redwood Shores, California, 94065, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of Oracle Corporation.
 */

package oracle.jdeveloper.html;

import oracle.jbo.Row;

/**
 *
 *	Represents a text field render.
 *
 * @author  Juan Oropeza
 * @version PUBLIC
 *
 **/
public class PasswordField extends TextField
{
   public PasswordField()
   {
   }

   public String createPasswordField()
   {
      HTMLInputElement input = new HTMLInputElement();
      
      input.setType("PASSWORD");
      input.setHtmlAttributes(htmlAttributes);

      return input.getAsString();
   }

   public String renderToString(Row row)
   {
      setValueFromRow(row);
      
      if (getDisplayWidth() <= 0)
      {
         setDisplayWidth(20);
      }

      return createPasswordField();
   }
}