Package net.xoetrope.builder.w3c.html.tags

Source Code of net.xoetrope.builder.w3c.html.tags.TextArea

package net.xoetrope.builder.w3c.html.tags;

import net.xoetrope.builder.w3c.html.XHtmlBuilder;
import javax.swing.text.MutableAttributeSet;
import javax.swing.text.html.HTML;
import net.xoetrope.swing.XTextArea;
import net.xoetrope.xui.XComponentFactory;

/**
* Processing for the html TextArea element
* <p> Copyright (c) Xoetrope Ltd., 2002-2006</p>
* <p> $Revision: 1.2 $</p>
* <p> License: see License.txt</p>
*/

public class TextArea extends XHtmlTagHandler
  /**
   * Creates a new instance of TextArea
   */
  public TextArea()
  {
  }
  /**
   * Create a new instance of this object
   * @param builder the html builder and processor for the document
   * @param parent the parent handler
   * @return the new handler
   */
  public XHtmlTagHandler newInstance( XHtmlBuilder builder, XHtmlTagHandler parent )
  {
    TextArea i = new TextArea();
    i.setParent( parent );
    i.setBuilder( builder );
    return i;
  }
 
  /**
   * Process the html tag/element
   * @param builder the xui builder instance that is processing the html file
   * @param cf the component factory to use for the creation of individual components
   * @param as the attributes of this html tag.
   */
  public void startProcessing( XHtmlBuilder builder, XComponentFactory cf, MutableAttributeSet as )
  {
    super.startProcessing( builder, cf, as );
   
    comp = new XTextArea();
    Object value = as.getAttribute( HTML.Attribute.COLS );
    if ( value != null )
      ((XTextArea)comp).setColumns( Integer.parseInt( value.toString()));
    parentComponent.add( comp );
    cf.setParentComponent( comp );
  }
}
TOP

Related Classes of net.xoetrope.builder.w3c.html.tags.TextArea

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.