Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.swing.text
Class DefaultStyledDocument.ElementSpec  view DefaultStyledDocument.ElementSpec download DefaultStyledDocument.ElementSpec.java

java.lang.Object
  extended byjavax.swing.text.DefaultStyledDocument.ElementSpec
Enclosing class:
DefaultStyledDocument

public static class DefaultStyledDocument.ElementSpec
extends java.lang.Object

Carries specification information for new Elements that should be created in ElementBuffer. This allows the parsing process to be decoupled from the Element creation process.


Field Summary
(package private)  AttributeSet attributes
          The attributes for the tag.
(package private)  char[] content
          The actual content.
static short ContentType
          This indicates a content element.
(package private)  short direction
          The direction of the tag.
static short EndTagType
          This indicates an end tag.
static short JoinFractureDirection
          This indicates that the data associated with this spec should be joined to the fractured element.
static short JoinNextDirection
          This indicates that the data associated with this spec should be joined with what follows it.
static short JoinPreviousDirection
          This indicates that the data associated with this spec should be joined with what precedes it.
(package private)  int length
          The length of the content.
(package private)  int offset
          The offset of the content.
static short OriginateDirection
          This indicates that the data associated with this spec should be used to create a new element.
static short StartTagType
          This indicates a start tag.
(package private)  short type
          The type of the tag.
 
Constructor Summary
DefaultStyledDocument.ElementSpec(AttributeSet a, short type)
          Creates a new ElementSpec with no content, length or offset.
DefaultStyledDocument.ElementSpec(AttributeSet a, short type, char[] txt, int offs, int len)
          Creates a new ElementSpec with document content.
DefaultStyledDocument.ElementSpec(AttributeSet a, short type, int len)
          Creates a new ElementSpec that specifies the length but not the offset of an element.
 
Method Summary
 char[] getArray()
          Returns the actual content of the element.
 AttributeSet getAttributes()
          Returns the attributes of the element.
 short getDirection()
          Returns the direction of the element.
 int getLength()
          Returns the length of the content.
 int getOffset()
          Returns the offset of the content.
 short getType()
          Returns the type of the element.
 void setDirection(short dir)
          Sets the direction of the element.
 void setType(short type)
          Sets the type of the element.
 java.lang.String toString()
          Returns a String representation of this ElementSpec describing the type, direction and length of this ElementSpec.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

StartTagType

public static final short StartTagType
This indicates a start tag. This is a possible value for getType() 55 .

See Also:
Constant Field Values

EndTagType

public static final short EndTagType
This indicates an end tag. This is a possible value for getType() 55 .

See Also:
Constant Field Values

ContentType

public static final short ContentType
This indicates a content element. This is a possible value for getType() 55 .

See Also:
Constant Field Values

JoinPreviousDirection

public static final short JoinPreviousDirection
This indicates that the data associated with this spec should be joined with what precedes it. This is a possible value for getDirection() 55 .

See Also:
Constant Field Values

JoinNextDirection

public static final short JoinNextDirection
This indicates that the data associated with this spec should be joined with what follows it. This is a possible value for getDirection() 55 .

See Also:
Constant Field Values

OriginateDirection

public static final short OriginateDirection
This indicates that the data associated with this spec should be used to create a new element. This is a possible value for getDirection() 55 .

See Also:
Constant Field Values

JoinFractureDirection

public static final short JoinFractureDirection
This indicates that the data associated with this spec should be joined to the fractured element. This is a possible value for getDirection() 55 .

See Also:
Constant Field Values

type

short type
The type of the tag.


direction

short direction
The direction of the tag.


offset

int offset
The offset of the content.


length

int length
The length of the content.


content

char[] content
The actual content.


attributes

AttributeSet attributes
The attributes for the tag.

Constructor Detail

DefaultStyledDocument.ElementSpec

public DefaultStyledDocument.ElementSpec(AttributeSet a,
                                         short type)
Creates a new ElementSpec with no content, length or offset. This is most useful for start and end tags.


DefaultStyledDocument.ElementSpec

public DefaultStyledDocument.ElementSpec(AttributeSet a,
                                         short type,
                                         int len)
Creates a new ElementSpec that specifies the length but not the offset of an element. Such ElementSpecs are processed sequentially from a known starting point.


DefaultStyledDocument.ElementSpec

public DefaultStyledDocument.ElementSpec(AttributeSet a,
                                         short type,
                                         char[] txt,
                                         int offs,
                                         int len)
Creates a new ElementSpec with document content.

Method Detail

setType

public void setType(short type)
Sets the type of the element.


getType

public short getType()
Returns the type of the element.


setDirection

public void setDirection(short dir)
Sets the direction of the element.


getDirection

public short getDirection()
Returns the direction of the element.


getAttributes

public AttributeSet getAttributes()
Returns the attributes of the element.


getArray

public char[] getArray()
Returns the actual content of the element.


getOffset

public int getOffset()
Returns the offset of the content.


getLength

public int getLength()
Returns the length of the content.


toString

public java.lang.String toString()
Returns a String representation of this ElementSpec describing the type, direction and length of this ElementSpec.