cox.jmatt.java.MathTools.markup.html
Class PTag

java.lang.Object
  extended by cox.jmatt.java.MathTools.markup.Tag
      extended by cox.jmatt.java.MathTools.markup.html.BaseHTag
          extended by cox.jmatt.java.MathTools.markup.html.ContainerTag
              extended by cox.jmatt.java.MathTools.markup.html.PTag
Direct Known Subclasses:
DivTag

public class PTag
extends ContainerTag

This class implements the <p> tag, the paragraph block. It also forms the superclass for the other block-structure tags <div> and <body>. Each of these has a level constant associated with it and as a rule these tags can only contain other tags whose level is greater. The partial exception is that <div> tags can contain other <div> tags. MathTools considers this tag the most atomic structural block-level tag so it can contain any of the SimpleDecorationTag, ListTag, DLTag, IMGTag, and TableTag instances.

For numeric comparison, BODY_LEVEL < DIV_LEVEL < P_LEVEL.


Nested Class Summary
 
Nested classes/interfaces inherited from class cox.jmatt.java.MathTools.markup.html.BaseHTag
BaseHTag.TagKeys
 
Field Summary
static byte BODY_LEVEL
          Static constant for the outermost container level ('<body>').
static byte DIV_LEVEL
          <div>-level constant.
protected  byte myLevel
          This field is used to hold the _LEVEL value of this tag.
static byte P_LEVEL
          Level constant for paragraph blocks.
 
Fields inherited from class cox.jmatt.java.MathTools.markup.Tag
myTagName
 
Constructor Summary
  PTag()
           
protected PTag(BaseHTag.TagKeys pTag)
          Protected subclass constructor.
 
Method Summary
 void add(PTag pTag)
          Add a PTag subclass.
 void add(SimpleDecorationTag pTag)
          Add a SimpleDecorationTag instance.
 void addDef(DLTag pTag)
          Add a DLTag.
 void addImage(IMGTag pTag)
          Add an IMGTag.
 void addList(ListTag pTag)
          Add a ListTag.
 void addTable(TableTag pTag)
          Add a TableTag.
 PTag copyOf()
          Create a copy of this tag.
 byte level()
          This method is used to return the _LEVEL constant associated with this particular tag class.
 
Methods inherited from class cox.jmatt.java.MathTools.markup.html.ContainerTag
addAnchor, addBold, addBQ, addBreak, addEM, addHeading, addHR, addImage, addItalic, addUnderline
 
Methods inherited from class cox.jmatt.java.MathTools.markup.html.BaseHTag
_addTag, _content, _enableCopy, _setContent, addCDATA, addContent, getID, getRawContent, getTagKey, getTagName, isInBody, setClicked, setCSS, setName, setStyle
 
Methods inherited from class cox.jmatt.java.MathTools.markup.Tag
_addAttribute, _addAttributes, _addNAttribute, _asBoolean, _asDouble, _asInt, _attributes, _clampNAttribute, _clampNAttribute, _fixKey, _setEnableXMLTag, badPizza, closeTag, configureTag, configureTagFromGlobalPizza, makeTag, openTag, reset, setID, toString, validString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BODY_LEVEL

public static final byte BODY_LEVEL
Static constant for the outermost container level ('<body>').

See Also:
Constant Field Values

DIV_LEVEL

public static final byte DIV_LEVEL
<div>-level constant.

See Also:
Constant Field Values

P_LEVEL

public static final byte P_LEVEL
Level constant for paragraph blocks.

See Also:
Constant Field Values

myLevel

protected byte myLevel
This field is used to hold the _LEVEL value of this tag. It is used for comparison with the level() method to determine containment.

Constructor Detail

PTag

public PTag()

PTag

protected PTag(BaseHTag.TagKeys pTag)
Protected subclass constructor.

Method Detail

copyOf

public PTag copyOf()
Create a copy of this tag.


level

public byte level()

This method is used to return the _LEVEL constant associated with this particular tag class. It is used to determine which tags can contain what.

The standard rule is that no tag class can contain any tag of lesser or equal level to itself: <div> can contain <p> but not vise versa. The only exception is that <div> tags can contain other <div> tags.


add

public final void add(PTag pTag)
Add a PTag subclass.


addList

public void addList(ListTag pTag)
Add a ListTag.


addDef

public void addDef(DLTag pTag)
Add a DLTag.


addTable

public void addTable(TableTag pTag)
Add a TableTag.


addImage

public void addImage(IMGTag pTag)
Add an IMGTag.


add

public void add(SimpleDecorationTag pTag)
Add a SimpleDecorationTag instance. Item tags are not added.