Class TextViewHTMLMarker
All Packages Class Hierarchy This Package Previous Next Index
Class TextViewHTMLMarker
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
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.
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.
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.
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.
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.
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
public String marker()
- Return the HTML marker
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
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 Oct 1997