javax.swing.text
Class DefaultStyledDocument.ElementSpec

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.swing.text.DefaultStyledDocument.ElementSpec
Enclosing class:
DefaultStyledDocument sample code for javax.swing.text.DefaultStyledDocument definition code for javax.swing.text.DefaultStyledDocument

public static class DefaultStyledDocument.ElementSpec
extends Object sample code for java.lang.Object definition code for java.lang.Object

Specification for building elements.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .


Field Summary
static short ContentType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.ContentType definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.ContentType
          A possible value for getType.
static short EndTagType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.EndTagType definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.EndTagType
          A possible value for getType.
static short JoinFractureDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinFractureDirection definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinFractureDirection
          A possible value for getDirection.
static short JoinNextDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinNextDirection definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinNextDirection
          A possible value for getDirection.
static short JoinPreviousDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinPreviousDirection definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinPreviousDirection
          A possible value for getDirection.
static short OriginateDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.OriginateDirection definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.OriginateDirection
          A possible value for getDirection.
static short StartTagType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.StartTagType definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.StartTagType
          A possible value for getType.
 
Constructor Summary
DefaultStyledDocument.ElementSpec sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  a, short type)
          Constructor useful for markup when the markup will not be stored in the document.
DefaultStyledDocument.ElementSpec sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short, char[], int, int) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short, char[], int, int) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  a, short type, char[] txt, int offs, int len)
          Constructor for creating a spec externally for batch input of content and markup into the document.
DefaultStyledDocument.ElementSpec sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short, int) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short, int) (AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  a, short type, int len)
          Constructor for parsing inside the document when the data has already been added, but len information is needed.
 
Method Summary
 char[] getArray sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getArray() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getArray() ()
          Gets the array of characters.
 AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet getAttributes sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getAttributes() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getAttributes() ()
          Gets the element attributes.
 short getDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getDirection() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getDirection() ()
          Gets the direction.
 int getLength sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getLength() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getLength() ()
          Gets the length.
 int getOffset sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getOffset() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getOffset() ()
          Gets the starting offset.
 short getType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getType() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getType() ()
          Gets the element type.
 void setDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.setDirection(short) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.setDirection(short) (short direction)
          Sets the direction.
 void setType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.setType(short) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.setType(short) (short type)
          Sets the element type.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.toString() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.toString() ()
          Converts the element to a string.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

StartTagType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.StartTagType

public static final short StartTagType
A possible value for getType. This specifies that this record type is a start tag and represents markup that specifies the start of an element.

See Also:
Constant Field Values

EndTagType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.EndTagType

public static final short EndTagType
A possible value for getType. This specifies that this record type is a end tag and represents markup that specifies the end of an element.

See Also:
Constant Field Values

ContentType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.ContentType

public static final short ContentType
A possible value for getType. This specifies that this record type represents content.

See Also:
Constant Field Values

JoinPreviousDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinPreviousDirection

public static final short JoinPreviousDirection
A possible value for getDirection. This specifies that the data associated with this record should be joined to what precedes it.

See Also:
Constant Field Values

JoinNextDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinNextDirection

public static final short JoinNextDirection
A possible value for getDirection. This specifies that the data associated with this record should be joined to what follows it.

See Also:
Constant Field Values

OriginateDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.OriginateDirection

public static final short OriginateDirection
A possible value for getDirection. This specifies that the data associated with this record should be used to originate a new element. This would be the normal value.

See Also:
Constant Field Values

JoinFractureDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.JoinFractureDirection

public static final short JoinFractureDirection
A possible value for getDirection. This specifies that the data associated with this record should be joined to the fractured element.

See Also:
Constant Field Values
Constructor Detail

DefaultStyledDocument.ElementSpec sample code for javax.swing.text.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short)

public DefaultStyledDocument.ElementSpec(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  a,
                                         short type)
Constructor useful for markup when the markup will not be stored in the document.

Parameters:
a - the attributes for the element
type - the type of the element (StartTagType, EndTagType, ContentType)

DefaultStyledDocument.ElementSpec sample code for javax.swing.text.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short, int) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short, int)

public DefaultStyledDocument.ElementSpec(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  a,
                                         short type,
                                         int len)
Constructor for parsing inside the document when the data has already been added, but len information is needed.

Parameters:
a - the attributes for the element
type - the type of the element (StartTagType, EndTagType, ContentType)
len - the length >= 0

DefaultStyledDocument.ElementSpec sample code for javax.swing.text.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short, char[], int, int) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec(javax.swing.text.AttributeSet, short, char[], int, int)

public DefaultStyledDocument.ElementSpec(AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  a,
                                         short type,
                                         char[] txt,
                                         int offs,
                                         int len)
Constructor for creating a spec externally for batch input of content and markup into the document.

Parameters:
a - the attributes for the element
type - the type of the element (StartTagType, EndTagType, ContentType)
txt - the text for the element
offs - the offset into the text >= 0
len - the length of the text >= 0
Method Detail

setType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.setType(short) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.setType(short)

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

Parameters:
type - the type of the element (StartTagType, EndTagType, ContentType)

getType sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getType() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getType()

public short getType()
Gets the element type.

Returns:
the type of the element (StartTagType, EndTagType, ContentType)

setDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.setDirection(short) definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.setDirection(short)

public void setDirection(short direction)
Sets the direction.

Parameters:
direction - the direction (JoinPreviousDirection, JoinNextDirection)

getDirection sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getDirection() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getDirection()

public short getDirection()
Gets the direction.

Returns:
the direction (JoinPreviousDirection, JoinNextDirection)

getAttributes sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getAttributes() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getAttributes()

public AttributeSet sample code for javax.swing.text.AttributeSet definition code for javax.swing.text.AttributeSet  getAttributes()
Gets the element attributes.

Returns:
the attribute set

getArray sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getArray() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getArray()

public char[] getArray()
Gets the array of characters.

Returns:
the array

getOffset sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getOffset() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getOffset()

public int getOffset()
Gets the starting offset.

Returns:
the offset >= 0

getLength sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.getLength() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.getLength()

public int getLength()
Gets the length.

Returns:
the length >= 0

toString sample code for javax.swing.text.DefaultStyledDocument.ElementSpec.toString() definition code for javax.swing.text.DefaultStyledDocument.ElementSpec.toString()

public String sample code for java.lang.String definition code for java.lang.String  toString()
Converts the element to a string.

Overrides:
toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
the string