FormattedTextFragmentCollection
Leave feedback
On this page
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.
| Constructor | Description |
|---|---|
| FormattedTextFragmentCollection(int collectionType) |
public FormattedTextFragmentCollection(int collectionType)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| collectionType | int |
public final int getCollectionType()
Gets the formatted fragment collection type.
Returns: int - The formatted fragment collection type.
public final Font getDefaultFont()
Returns: Font
public final Color getDefaultForegroundColor()
Returns: Color
public final Color getDefaultBackgroundColor()
Returns: Color
public String getText()
Returns: java.lang.String
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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
public void setText(String text)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| text | java.lang.String |
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.