public class TextPart extends AbstractFontElement
Paragraph.addTextPart(String)
method from class Paragraph
instead.
TextPart tPartHello = paragraph.addTextPart("hello ");
TextPart tPartWorld = paragraph.addTextPart("World");
tPartWorld.setFontBold(true);
paragraph
is a reference to a line of a text you want to insert. The method addTextPart
creates a new instance of TextPart
, initialize it with
the given String
and formats it with default. The method saves one reference to the new TextPart
into paragraph
and returns one. In the example it
happens twice times, because the two parts get different format. If the whole String
should use the same format add only one TextPart
with both words.Text
,
Paragraph
,
FieldPart
,
Serialized FormBOX, CHART, CROSSTAB, CROSSTABSECTION, DATABASE_PICTURE, FIELD, FIELDPART, FORMFIELD, INTERACTIVE_SORTING, JAVABEAN, LINE, PARAGRAPH, PICTURE, SIGNATURE, SUBREPORT, TEXT, TEXTPART
FONT_DIALOG, FONT_MONOSPACED, FONT_SANS_SERIF, FONT_SERIF, FONT_STYLE_BOLD, FONT_STYLE_ITALIC, FONT_STYLE_STRIKETHROUGH, FONT_STYLE_UNDERLINE
ALIGN_HORIZONTAL_CENTER, ALIGN_HORIZONTAL_DEFAULT, ALIGN_HORIZONTAL_JUSTIFIED, ALIGN_HORIZONTAL_LEFT, ALIGN_HORIZONTAL_RIGHT
Modifier and Type | Method and Description |
---|---|
int |
getHorAlign()
Use the value of the parent paragraph.
|
FormulaField |
getHorAlignFormula()
Use the value of the parent paragraph.
|
Paragraph |
getParentParagraph()
Returns this field part's parent's paragraph.
|
java.util.List<? extends ReportComponent> |
getSubComponents()
Returns all
ReportComponent s that are descendants of this one. |
java.lang.String |
getText()
Gets the value of the property 'text'.
|
int |
indexOf()
Returns The current index of this text part in its paragraph.
|
java.lang.String |
paramString()
Creates and return a String representation for debugging.
|
void |
setHorAlign(int value)
Use the value of the parent paragraph.
|
void |
setHorAlignFormula(FormulaField newFormula)
Use the value of the parent paragraph.
|
void |
setText(java.lang.String newValue)
Sets the value of the property 'text'.
|
getFontColor, getFontColorFormula, getFontName, getFontNameFormula, getFontSize, getFontSizeFormula, getFontSizeTwips, getFontStyle, getFontStyleFormula, getPropertyFormulas, getStrikeoutFormula, getUnderlineFormula, isBold, isItalic, isStrikeout, isUnderline, setBold, setFontColor, setFontColorFormula, setFontName, setFontNameFormula, setFontSize, setFontSizeFormula, setFontSizeTwips, setFontStyle, setFontStyleFormula, setItalic, setStrikeout, setStrikeoutFormula, setUnderline, setUnderlineFormula
addListener, copy, getBottomLineStyle, getBottomLineStyleFormula, getCanGrowCount, getCanGrowFormula, getCloseBorderOnPageBreakFormula, getDropShadowFormula, getEngine, getField, getForeColor, getForeColorFormula, getHyperlinkUrl, getHyperlinkUrlFormula, getLeftLineStyle, getLeftLineStyleFormula, getParent, getRightLineStyle, getRightLineStyleFormula, getSuppressIfDuplicatedFormula, getTightHorizontalFormula, getToolTipsText, getToolTipsTextFormula, getTopLineStyle, getTopLineStyleFormula, isCanGrow, isCloseBorderOnPageBreak, isDropShadow, isSuppressIfDuplicated, isTightHorizontal, removeListener, setBottomLineStyle, setBottomLineStyleFormula, setCanGrow, setCanGrowCount, setCanGrowFormula, setCloseBorderOnPageBreak, setCloseBorderOnPageBreakFormula, setDropShadow, setDropShadowFormula, setField, setForeColor, setForeColorFormula, setHyperlinkUrl, setHyperlinkUrlFormula, setIndex, setLeftLineStyle, setLeftLineStyleFormula, setRightLineStyle, setRightLineStyleFormula, setSuppressIfDuplicated, setSuppressIfDuplicatedFormula, setTightHorizontal, setTightHorizontalFormula, setToolTipsText, setToolTipsTextFormula, setTopLineStyle, setTopLineStyleFormula
getBackColor, getBackColorFormula, getHeight, getKeepTogetherFormula, getSuppressFormula, getType, getWidth, getX, getY, isKeepTogether, isSuppress, setBackColor, setBackColorFormula, setHeight, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula, setWidth, setX, setY
getKeepTogetherFormula, getSuppressFormula, isKeepTogether, isSuppress, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
public Paragraph getParentParagraph()
Paragraph
public java.lang.String getText()
public void setText(java.lang.String newValue)
newValue
- The new value of the property 'text'.public java.lang.String paramString()
paramString
in class Element
public int indexOf()
indexOf
in class Element
Element.setIndex(int)
public int getHorAlign()
getHorAlign
in interface GeneralProperties
getHorAlign
in class Element
GeneralProperties.ALIGN_HORIZONTAL_DEFAULT
,
GeneralProperties.ALIGN_HORIZONTAL_LEFT
,
GeneralProperties.ALIGN_HORIZONTAL_CENTER
,
GeneralProperties.ALIGN_HORIZONTAL_RIGHT
,
GeneralProperties.ALIGN_HORIZONTAL_JUSTIFIED
public FormulaField getHorAlignFormula()
getHorAlignFormula
in interface GeneralProperties
getHorAlignFormula
in class Element
public void setHorAlign(int value)
setHorAlign
in interface GeneralProperties
setHorAlign
in class Element
value
- The new value of the property 'horizontal alignment'.GeneralProperties.ALIGN_HORIZONTAL_DEFAULT
,
GeneralProperties.ALIGN_HORIZONTAL_LEFT
,
GeneralProperties.ALIGN_HORIZONTAL_CENTER
,
GeneralProperties.ALIGN_HORIZONTAL_RIGHT
,
GeneralProperties.ALIGN_HORIZONTAL_JUSTIFIED
public void setHorAlignFormula(FormulaField newFormula)
setHorAlignFormula
in interface GeneralProperties
setHorAlignFormula
in class Element
newFormula
- The new formula for the property 'horizontal alignment'.
The result of the formula should be in range from 0 to 4.GeneralProperties.ALIGN_HORIZONTAL_DEFAULT
,
GeneralProperties.ALIGN_HORIZONTAL_LEFT
,
GeneralProperties.ALIGN_HORIZONTAL_CENTER
,
GeneralProperties.ALIGN_HORIZONTAL_RIGHT
,
GeneralProperties.ALIGN_HORIZONTAL_JUSTIFIED
public java.util.List<? extends ReportComponent> getSubComponents()
ReportComponent
s that are descendants of this one. E.G. this will return all Element
of a Section
. But it's as well useful for CrossTab
s or Text
elements which have
additional elements.getSubComponents
in class ReportComponent
null
if the component has no descendantsCopyright © 1999-2020 by i-net software GmbH