Class TextViewHTMLMarker
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class TextViewHTMLMarker *Beta API*

public abstract class netscape.application.TextViewHTMLMarker
    extends netscape.application.TextViewHTMLElement
{
    /* Constructors
     */
    public TextViewHTMLMarker();

    /* Methods
     */
    public Hashtable attributes();
    public Hashtable attributesForMarker(Hashtable, Hashtable, TextView);
    public Hashtable attributesForPrefix(Hashtable, Hashtable, TextView);
    public Hashtable attributesForSuffix(Hashtable, Hashtable, TextView);
    public String marker();
    public String prefix(Hashtable, char);
    public abstract String string(Hashtable);
    public String suffix(Hashtable, char);
    public String toString();
}
Instances of this class are used to store single markers like IMG or HR. If you need to add some support for another marker, subclass TextViewHTMLMarker and use TextView.setHTMLMarkerClass() to tell TextView to use your subclass.

Constructors

TextViewHTMLMarker

  public TextViewHTMLMarker()

Methods

prefix

  public String prefix(Hashtable context,
                       char lastChar)
You can override this method to return what string should prefix the marker. This method is usualy used to add extra characters like cariage returns. context is the context lastchar is the last character added to the textView. It is often useful to check if lastChar is '\n' before adding another '\n' The default implementation returns nothing.

suffix

  public String suffix(Hashtable context,
                       char lastChar)
You can override this method to return what string should suffix the marker. This method is usualy used to add extra characters like cariage returns. context is the context lastchar is the last character added to the textView. It is often useful to check if lastChar is '\n' before adding another '\n' The default implementation returns nothing.

attributesForPrefix

  public Hashtable attributesForPrefix(Hashtable context,
                                       Hashtable initialAttributes,
                                       TextView textView)
Compute the TextView attributes for the prefix according to the context and initial attributes. Return the new attributes. The default implementation returns initialAttributes . It is not necessary to allocate a new hashtable.You can just modify initialAttributes and return it. textView is the TextView for which the HTML is parsed.

attributesForMarker

  public Hashtable attributesForMarker(Hashtable context,
                                       Hashtable initialAttributes,
                                       TextView textView)
Compute the TextView attributes for the marker itself (the string returned by string() according to context and initial attributes. Return the new attributes. The default implementation returns initialAttributes It is not necessary to allocate a new hashtable.You can just modify initialAttributes and return it. textView is the TextView for which the HTML is parsed.

attributesForSuffix

  public Hashtable attributesForSuffix(Hashtable context,
                                       Hashtable initialAttributes,
                                       TextView textView)
Compute the TextView attributes for the suffix according to the context and initial attributes. Return the new attributes. The default implementation returns initialAttributes . It is not necessary to allocate a new hashtable.You can just modify initialAttributes and return it. textView is the TextView for which the HTML is parsed.

string

  public abstract String string(Hashtable context)
Return the string for this marker given the context context You have to override this method.
Overrides:
string in class TextViewHTMLElement

marker

  public String marker()
Return the HTML marker

attributes

  public Hashtable attributes()
Return the HTML attributes in an hashtable. Ex: for will produce an hashtable with one key "FOO" with a value "1" as a string

toString

  public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Apr 1997