// TextViewHTMLString.java
// By Ned Etcode
// Copyright 1996 Netscape Communications Corp.  All rights reserved.

package netscape.application;
import netscape.util.*;

/** This class should be private and is used to parse some HTML in the textview.
 *  It is public to allow getClass() to work
 *
 *  @private
 */
public class TextViewHTMLString implements HTMLElement, TextViewHTMLElement {
    String string;

    /** Return the string for the component */
    public void appendString(Hashtable context,FastStringBuffer fb) {
      fb.append(string);
    }

    /** Set the attributes for the string starting at index index */
    public void setAttributesStartingAt(int index, Hashtable initialAttributes,TextView target,
                                        Hashtable context) {
      Range r;
        int length = length();
        if( initialAttributes != null ) {
          r = TextView.allocateRange(index,length());
          target.addAttributesForRange( initialAttributes , r );
          TextView.recycleRange(r);
        }
    }

    public int length() {
        if( string == null )
            return 0;
        else
            return string.length();
    }

    public void setString(String aString) {
        string = aString;
    }

    public void setMarker(String aString) {
    }

    public void setAttributes(String attributes) {
    }

    public void setChildren(Object child[]) {
    }
}









