FormattedTextFragmentCollection

Inheritance: java.lang.Object, com.groupdocs.watermark.common.ReadOnlyListBase, com.groupdocs.watermark.common.RemoveOnlyListBase

public class FormattedTextFragmentCollection extends RemoveOnlyListBase<FormattedTextFragment>

Represents a mutable collection of formatted text fragments.

This collection contains the items of [FormattedTextFragment](../../com.groupdocs.watermark.search/formattedtextfragment) base type.

Constructors

Constructor Description
FormattedTextFragmentCollection(int collectionType)

Methods

Method Description
getCollectionType() Gets the formatted fragment collection type.
getDefaultFont()
getDefaultForegroundColor()
getDefaultBackgroundColor()
getText()
add(String text) Adds a formatted text fragment to the collection.
add(String text, Font font) Adds a formatted text fragment to the collection.
add(String text, Font font, Color foregroundColor) Adds a formatted text fragment to the collection.
add(String text, Font font, Color foregroundColor, Color backgroundColor) Adds a formatted text fragment to the collection.
insert(int index, String text) Inserts a formatted text fragment into the collection at a given index.
insert(int index, String text, Font font) Inserts a formatted text fragment into the collection at a given index.
insert(int index, String text, Font font, Color foregroundColor) Inserts a formatted text fragment into the collection at a given index.
insert(int index, String text, Font font, Color foregroundColor, Color backgroundColor) Inserts a formatted text fragment into the collection at a given index.
createInDocument(int index, String text, Font font, Color foregroundColor, Color backgroundColor)
setText(String text)

FormattedTextFragmentCollection(int collectionType)

public FormattedTextFragmentCollection(int collectionType)

Parameters:

Parameter Type Description
collectionType int

getCollectionType()

public final int getCollectionType()

Gets the formatted fragment collection type.

Returns: int - The formatted fragment collection type.

getDefaultFont()

public final Font getDefaultFont()

Returns: Font

getDefaultForegroundColor()

public final Color getDefaultForegroundColor()

Returns: Color

getDefaultBackgroundColor()

public final Color getDefaultBackgroundColor()

Returns: Color

getText()

public String getText()

Returns: java.lang.String

add(String text)

public final void add(String text)

Adds a formatted text fragment to the collection.

Parameters:

Parameter Type Description
text java.lang.String The fragment text.

add(String text, Font font)

public final void add(String text, Font font)

Adds a formatted text fragment to the collection.

Parameters:

Parameter Type Description
text java.lang.String The fragment text.
font Font The font of the text.

add(String text, Font font, Color foregroundColor)

public final void add(String text, Font font, Color foregroundColor)

Adds a formatted text fragment to the collection.

Parameters:

Parameter Type Description
text java.lang.String The fragment text.
font Font The font of the text.
foregroundColor Color The foreground color of the text.

add(String text, Font font, Color foregroundColor, Color backgroundColor)

public final void add(String text, Font font, Color foregroundColor, Color backgroundColor)

Adds a formatted text fragment to the collection.

Parameters:

Parameter Type Description
text java.lang.String The fragment text.
font Font The font of the text.
foregroundColor Color The foreground color of the text.
backgroundColor Color The background color of the text.

insert(int index, String text)

public final void insert(int index, String text)

Inserts a formatted text fragment into the collection at a given index.

Parameters:

Parameter Type Description
index int The zero-based index at which formatted text fragment should be inserted.
text java.lang.String The fragment text.

insert(int index, String text, Font font)

public final void insert(int index, String text, Font font)

Inserts a formatted text fragment into the collection at a given index.

Parameters:

Parameter Type Description
index int The zero-based index at which formatted text fragment should be inserted.
text java.lang.String The fragment text.
font Font The font of the text.

insert(int index, String text, Font font, Color foregroundColor)

public final void insert(int index, String text, Font font, Color foregroundColor)

Inserts a formatted text fragment into the collection at a given index.

Parameters:

Parameter Type Description
index int The zero-based index at which formatted text fragment should be inserted.
text java.lang.String The fragment text.
font Font The font of the text.
foregroundColor Color The foreground color of the text.

insert(int index, String text, Font font, Color foregroundColor, Color backgroundColor)

public final void insert(int index, String text, Font font, Color foregroundColor, Color backgroundColor)

Inserts a formatted text fragment into the collection at a given index.

Parameters:

Parameter Type Description
index int The zero-based index at which formatted text fragment should be inserted.
text java.lang.String The fragment text.
font Font The font of the text.
foregroundColor Color The foreground color of the text.
backgroundColor Color The background color of the text.

createInDocument(int index, String text, Font font, Color foregroundColor, Color backgroundColor)

public FormattedTextFragment createInDocument(int index, String text, Font font, Color foregroundColor, Color backgroundColor)

Parameters:

Parameter Type Description
index int
text java.lang.String
font Font
foregroundColor Color
backgroundColor Color

Returns: FormattedTextFragment

setText(String text)

public void setText(String text)

Parameters:

Parameter Type Description
text java.lang.String