Package org.eclipse.swt.custom
Class StyledTextPrintOptions
java.lang.Object
org.eclipse.swt.custom.StyledTextPrintOptions
Use StyledTextPrintOptions to specify printing options for the
StyledText.print(Printer, StyledTextPrintOptions) API.
The following example prints a right aligned page number in the footer, sets the job name to "Example" and prints line background colors but no other formatting:
StyledTextPrintOptions options = new StyledTextPrintOptions(); options.footer = "\t\t<page>"; options.jobName = "Example"; options.printLineBackground = true; Runnable runnable = styledText.print(new Printer(), options); runnable.run();
- Since:
- 2.1
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionFormatted text to print in the footer of each page.Formatted text to print in the header of each page.Name of the print job.String[]
Labels used for printing line numbers.static final String
Page number placeholder constant for use inheader
andfooter
.boolean
Print the line background color.boolean
Print line numbers.boolean
Print the text background color.boolean
Print the font styles.boolean
Print the text foreground color.static final String
Separator constant for use inheader
andfooter
. -
Constructor Summary
-
Method Summary
-
Field Details
-
PAGE_TAG
Page number placeholder constant for use inheader
andfooter
. Value is<page>
- See Also:
-
SEPARATOR
Separator constant for use inheader
andfooter
. Value is\t
- See Also:
-
header
Formatted text to print in the header of each page."left '\t' center '\t' right"
left, center, right = <page> | #CDATA
Header and footer are defined as three separate regions for arbitrary text or the page number placeholder <page> (
StyledTextPrintOptions.PAGE_TAG
). The three regions are left aligned, centered and right aligned. They are separated by a tab character (StyledTextPrintOptions.SEPARATOR
). -
jobName
Name of the print job. -
printTextForeground
public boolean printTextForegroundPrint the text foreground color. Default value isfalse
. -
printTextBackground
public boolean printTextBackgroundPrint the text background color. Default value isfalse
. -
printTextFontStyle
public boolean printTextFontStylePrint the font styles. Default value isfalse
. -
printLineBackground
public boolean printLineBackgroundPrint the line background color. Default value isfalse
. -
printLineNumbers
public boolean printLineNumbersPrint line numbers. Default value isfalse
.- Since:
- 3.3
-
lineLabels
Labels used for printing line numbers.- Since:
- 3.4
-
-
Constructor Details
-
StyledTextPrintOptions
public StyledTextPrintOptions()
-