fop 0.90alpha1

org.apache.fop.render.rtf.rtflib.rtfdoc
Class RtfTextrun

java.lang.Object
  extended byorg.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
      extended byorg.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
          extended byorg.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun
Direct Known Subclasses:
RtfListItem.RtfListItemLabel

public class RtfTextrun
extends RtfContainer

Class which contains a linear text run. It has methods to add attributes, text, paragraph breaks....

Author:
Peter Herweg, pherweg@web.de

Field Summary
 
Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
 
Method Summary
 void addBookmark(java.lang.String id)
           
 void addCloseGroupMark()
          Adds instance of CloseGroupMark as a child.
 RtfFootnote addFootnote()
           
 RtfHyperLink addHyperlink(RtfAttributes attr)
           
 void addOpenGroupMark(RtfAttributes attrs)
          Adds instance of OpenGroupMark as a child with attributes.
 void addPageNumber(RtfAttributes attr)
           
 void addParagraphBreak()
          Inserts paragraph break before all close group marks.
 void addString(java.lang.String s)
          Add string to children list.
 RtfListItem getRtfListItem()
           
static RtfTextrun getTextrun(RtfContainer container, java.io.Writer writer, RtfAttributes attrs)
          Adds a new RtfTextrun to the given container if necessary, and returns it.
 RtfExternalGraphic newImage()
           
 void popBlockAttributes()
          Pops block attributes, notifies all opened blocks about pushing block attributes, adds CloseGroupMark as a child.
 void popInlineAttributes()
          Pop inline attributes.
 void pushBlockAttributes(RtfAttributes attrs)
          Pushes block attributes, notifies all opened blocks about pushing block attributes, adds OpenGroupMark as a child.
 void pushInlineAttributes(RtfAttributes attrs)
          Pushes inline attributes.
 void setRtfListItem(RtfListItem listItem)
           
 void setSuppressLastPar(boolean bSuppress)
          specify, if the last paragraph control word (\par) should be suppressed.
protected  void writeRtfContent()
          write RTF code of all our children
 
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, getChildCount, getChildren, isEmpty, okToWriteRtf, setChildren, setOptions, toString
 
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeRtfPrefix, writeRtfSuffix, writeStarControlWord, writeStarControlWordNS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

addOpenGroupMark

public void addOpenGroupMark(RtfAttributes attrs)
                      throws java.io.IOException
Adds instance of OpenGroupMark as a child with attributes.

Parameters:
attrs - attributes to add
Throws:
java.io.IOException - for I/O problems

addCloseGroupMark

public void addCloseGroupMark()
                       throws java.io.IOException
Adds instance of CloseGroupMark as a child.

Throws:
java.io.IOException - for I/O problems

pushBlockAttributes

public void pushBlockAttributes(RtfAttributes attrs)
                         throws java.io.IOException
Pushes block attributes, notifies all opened blocks about pushing block attributes, adds OpenGroupMark as a child.

Parameters:
attrs - the block attributes to push
Throws:
java.io.IOException - for I/O problems

popBlockAttributes

public void popBlockAttributes()
                        throws java.io.IOException
Pops block attributes, notifies all opened blocks about pushing block attributes, adds CloseGroupMark as a child.

Throws:
java.io.IOException - for I/O problems

pushInlineAttributes

public void pushInlineAttributes(RtfAttributes attrs)
                          throws java.io.IOException
Pushes inline attributes.

Parameters:
attrs - the inline attributes to push
Throws:
java.io.IOException - for I/O problems

popInlineAttributes

public void popInlineAttributes()
                         throws java.io.IOException
Pop inline attributes.

Throws:
java.io.IOException - for I/O problems

addString

public void addString(java.lang.String s)
               throws java.io.IOException
Add string to children list.

Parameters:
s - string to add
Throws:
java.io.IOException - for I/O problems

addFootnote

public RtfFootnote addFootnote()
                        throws java.io.IOException
Throws:
java.io.IOException

addParagraphBreak

public void addParagraphBreak()
                       throws java.io.IOException
Inserts paragraph break before all close group marks.

Throws:
java.io.IOException - for I/O problems

addPageNumber

public void addPageNumber(RtfAttributes attr)
                   throws java.io.IOException
Throws:
java.io.IOException

addHyperlink

public RtfHyperLink addHyperlink(RtfAttributes attr)
                          throws java.io.IOException
Throws:
java.io.IOException

addBookmark

public void addBookmark(java.lang.String id)
                 throws java.io.IOException
Throws:
java.io.IOException

newImage

public RtfExternalGraphic newImage()
                            throws java.io.IOException
Throws:
java.io.IOException

getTextrun

public static RtfTextrun getTextrun(RtfContainer container,
                                    java.io.Writer writer,
                                    RtfAttributes attrs)
                             throws java.io.IOException
Adds a new RtfTextrun to the given container if necessary, and returns it.

Parameters:
container - RtfContainer, which is the parent of the returned RtfTextrun
writer - Writer of the given RtfContainer
attrs - RtfAttributes which are to write at the beginning of the RtfTextrun
Throws:
java.io.IOException - for I/O problems

setSuppressLastPar

public void setSuppressLastPar(boolean bSuppress)
specify, if the last paragraph control word (\par) should be suppressed.

Parameters:
bSuppress - true, if the last \par should be suppressed

writeRtfContent

protected void writeRtfContent()
                        throws java.io.IOException
write RTF code of all our children

Overrides:
writeRtfContent in class RtfContainer
Throws:
java.io.IOException - for I/O problems

setRtfListItem

public void setRtfListItem(RtfListItem listItem)

getRtfListItem

public RtfListItem getRtfListItem()

fop 0.90alpha1

Copyright 1999-2005 The Apache Software Foundation. All Rights Reserved.