Save This Page
Home » poi-src-3.2-FINAL-20081019 » org.apache » poi » hslf » model » [javadoc | source]
org.apache.poi.hslf.model
public class: TextRun [javadoc | source]
java.lang.Object
   org.apache.poi.hslf.model.TextRun
This class represents a run of text in a powerpoint document. That run could be text on a sheet, or text in a note. It is only a very basic class for now
Field Summary
protected  TextHeaderAtom _headerAtom     
protected  TextBytesAtom _byteAtom     
protected  TextCharsAtom _charAtom     
protected  StyleTextPropAtom _styleAtom     
protected  boolean _isUnicode     
protected  RichTextRun[] _rtRuns     
protected  Record[] _records    all text run records that follow TextHeaderAtom. (there can be misc InteractiveInfo, TxInteractiveInfo and other records) 
Constructor:
 public TextRun(TextHeaderAtom tha,
    TextCharsAtom tca,
    StyleTextPropAtom sta) 
    Constructs a Text Run from a Unicode text block
    Parameters:
    tha - the TextHeaderAtom that defines what's what
    tca - the TextCharsAtom containing the text
    sta - the StyleTextPropAtom which defines the character stylings
 public TextRun(TextHeaderAtom tha,
    TextBytesAtom tba,
    StyleTextPropAtom sta) 
    Constructs a Text Run from a Ascii text block
    Parameters:
    tha - the TextHeaderAtom that defines what's what
    tba - the TextBytesAtom containing the text
    sta - the StyleTextPropAtom which defines the character stylings
Method from org.apache.poi.hslf.model.TextRun Summary:
appendText,   changeTextInRichTextRun,   ensureStyleAtomPresent,   getHyperlinks,   getIndex,   getRawText,   getRecords,   getRichTextRunAt,   getRichTextRuns,   getRunType,   getShapeId,   getSheet,   getText,   getTextRuler,   normalize,   setIndex,   setRawText,   setRunType,   setShapeId,   setSheet,   setText,   supplySlideShow
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.poi.hslf.model.TextRun Detail:
 public RichTextRun appendText(String s) 
    Adds the supplied text onto the end of the TextRun, creating a new RichTextRun (returned) for it to sit in. In many cases, before calling this, you'll want to add a newline onto the end of your last RichTextRun
 public synchronized  void changeTextInRichTextRun(RichTextRun run,
    String s) 
    Handles an update to the text stored in one of the Rich Text Runs
 public synchronized  void ensureStyleAtomPresent() 
    Ensure a StyleTextPropAtom is present for this run, by adding if required. Normally for internal TextRun use.
 public Hyperlink[] getHyperlinks() 
    Returns the array of all hyperlinks in this text run
 protected int getIndex() 
 public String getRawText() 
    Returns the raw text content of the run. This hasn't had any changes applied to it, and so is probably unlikely to print out nicely.
 public Record[] getRecords() 
    Returns records that make up this text run
 public RichTextRun getRichTextRunAt(int pos) 
    Fetch RichTextRun at a given position
 public RichTextRun[] getRichTextRuns() 
    Fetch the rich text runs (runs of text with the same styling) that are contained within this block of text
 public int getRunType() 
    Returns the type of the text, from the TextHeaderAtom. Possible values can be seen from TextHeaderAtom
 protected int getShapeId() 
 public Sheet getSheet() 
 public String getText() 
    Returns the text content of the run, which has been made safe for printing and other use.
 public TextRulerAtom getTextRuler() 
 public String normalize(String s) 
    Returns a new string with line breaks converted into internal ppt representation
 protected  void setIndex(int id) 
 public synchronized  void setRawText(String s) 
    Changes the text, and sets it all to have the same styling as the the first character has. If you care about styling, do setText on a RichTextRun instead
 public  void setRunType(int type) 
    Changes the type of the text. Values should be taken from TextHeaderAtom. No checking is done to ensure you set this to a valid value!
 protected  void setShapeId(int id) 
 public  void setSheet(Sheet sheet) 
 public synchronized  void setText(String s) 
    Changes the text. Converts '\r' into '\n'
 public  void supplySlideShow(SlideShow ss) 
    Supply the SlideShow we belong to. Also passes it on to our child RichTextRuns