Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.poi.hslf.model
Class TextRun

    java.lang.Object
      org.apache.poi.hslf.model.TextRun

    public final class TextRun

extends java.lang.Object

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

Author:
  Nick Burch

Constructor Summary
`TextRun(TextHeaderAtom tha, TextBytesAtom tba, StyleTextPropAtom sta)` Constructs a Text Run from a Ascii text block
`TextRun(TextHeaderAtom tha, TextCharsAtom tca, StyleTextPropAtom sta)` Constructs a Text Run from a Unicode text block

Method Summary
`RichTextRun` | `appendText(java.lang.String s)` Adds the supplied text onto the end of the TextRun, creating a new RichTextRun (returned) for it to sit in.
`void` | `buildRichTextRuns(java.util.LinkedList pStyles, java.util.LinkedList cStyles, java.lang.String runRawText)`
`void` | `changeTextInRichTextRun(RichTextRun run, java.lang.String s)` Handles an update to the text stored in one of the Rich Text Runs
`TextRulerAtom` | `createTextRuler()`
`void` | `ensureStyleAtomPresent()` Ensure a StyleTextPropAtom is present for this run, by adding if required.
`Hyperlink[]` | `getHyperlinks()` Returns the array of all hyperlinks in this text run
`java.lang.String` | `getRawText()` Returns the raw text content of the run.
`Record[]` | `getRecords()` Returns records that make up this text run
`RichTextRun` | `getRichTextRunAt(int pos)` Fetch RichTextRun at a given position
`RichTextRun[]` | `getRichTextRuns()` Fetch the rich text runs (runs of text with the same styling) that are contained within this block of text
`int` | `getRunType()` Returns the type of the text, from the TextHeaderAtom.
`Sheet` | `getSheet()`
`java.lang.String` | `getText()` Returns the text content of the run, which has been made safe for printing and other use.
`TextRulerAtom` | `getTextRuler()`
`java.lang.String` | `normalize(java.lang.String s)` Returns a new string with line breaks converted into internal ppt representation
`void` | `setRawText(java.lang.String s)` Changes the text, and sets it all to have the same styling as the the first character has.
`void` | `setRunType(int type)` Changes the type of the text.
`void` | `setSheet(Sheet sheet)`
`void` | `setText(java.lang.String s)` Changes the text.
`void` | `supplySlideShow(SlideShow ss)` Supply the SlideShow we belong to.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TextRun

    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

### TextRun

    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 Detail

### buildRichTextRuns

    public void buildRichTextRuns(java.util.LinkedList pStyles,
                                  java.util.LinkedList cStyles,
                                  java.lang.String runRawText)

### appendText

    public RichTextRun appendText(java.lang.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

### changeTextInRichTextRun

    public void changeTextInRichTextRun(RichTextRun run,
                                        java.lang.String s)

  Handles an update to the text stored in one of the Rich Text Runs

  Parameters:
    `run` -
    `s` -

### setRawText

    public void setRawText(java.lang.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

### setText

    public void setText(java.lang.String s)

  Changes the text. Converts '\r' into '\n'

### ensureStyleAtomPresent

    public void ensureStyleAtomPresent()

  Ensure a StyleTextPropAtom is present for this run, by adding if required. Normally for internal TextRun use.

### getText

    public java.lang.String getText()

  Returns the text content of the run, which has been made safe for printing and other use.

### getRawText

    public java.lang.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.

### getRichTextRuns

    public RichTextRun[] getRichTextRuns()

  Fetch the rich text runs (runs of text with the same styling) that are contained within this block of text

### getRunType

    public int getRunType()

  Returns the type of the text, from the TextHeaderAtom. Possible values can be seen from TextHeaderAtom

  See Also:
    `TextHeaderAtom`

### setRunType

    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!

  See Also:
    `TextHeaderAtom`

### supplySlideShow

    public void supplySlideShow(SlideShow ss)

  Supply the SlideShow we belong to. Also passes it on to our child RichTextRuns

### setSheet

    public void setSheet(Sheet sheet)

### getSheet

    public Sheet getSheet()

### getHyperlinks

    public Hyperlink[] getHyperlinks()

  Returns the array of all hyperlinks in this text run

  Returns:
    the array of all hyperlinks in this text run or `null` if not found.

### getRichTextRunAt

    public RichTextRun getRichTextRunAt(int pos)

  Fetch RichTextRun at a given position

  Parameters:
    `pos` - 0-based index in the text
  Returns:
    RichTextRun or null if not found

### getTextRuler

    public TextRulerAtom getTextRuler()

### createTextRuler

    public TextRulerAtom createTextRuler()

### normalize

    public java.lang.String normalize(java.lang.String s)

  Returns a new string with line breaks converted into internal ppt representation

### getRecords

    public Record[] getRecords()

  Returns records that make up this text run

  Returns:
    text run records

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD