Mercurial > projects > dwt-mac
comparison dwt/custom/StyledTextPrintOptions.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 6337764516f1 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2006 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 *******************************************************************************/ | |
11 module dwt.custom; | |
12 | |
13 /** | |
14 * Use StyledTextPrintOptions to specify printing options for the | |
15 * StyledText.print(Printer, StyledTextPrintOptions) API. | |
16 * <p> | |
17 * The following example prints a right aligned page number in the footer, | |
18 * sets the job name to "Example" and prints line background colors but no other | |
19 * formatting: | |
20 * </p> | |
21 * <pre> | |
22 * StyledTextPrintOptions options = new StyledTextPrintOptions(); | |
23 * options.footer = "\t\t<page>"; | |
24 * options.jobName = "Example"; | |
25 * options.printLineBackground = true; | |
26 * | |
27 * Runnable runnable = styledText.print(new Printer(), options); | |
28 * runnable.run(); | |
29 * </pre> | |
30 * @since 2.1 | |
31 */ | |
32 public class StyledTextPrintOptions { | |
33 /** | |
34 * Page number placeholder constant for use in <code>header</code> | |
35 * and <code>footer</code>. Value is <code><page></code> | |
36 */ | |
37 public static final String PAGE_TAG = "<page>"; | |
38 /** | |
39 * Separator constant for use in <code>header</code> and | |
40 * <code>footer</code>. Value is <code>\t</code> | |
41 */ | |
42 public static final String SEPARATOR = "\t"; | |
43 /** | |
44 * Formatted text to print in the header of each page. | |
45 * <p>"left '\t' center '\t' right"</p> | |
46 * <p>left, center, right = <page> | #CDATA</p> | |
47 * <p>Header and footer are defined as three separate regions for arbitrary | |
48 * text or the page number placeholder <page> | |
49 * (<code>StyledTextPrintOptions.PAGE_TAG</code>). The three regions are | |
50 * left aligned, centered and right aligned. They are separated by a tab | |
51 * character (<code>StyledTextPrintOptions.SEPARATOR</code>). | |
52 */ | |
53 public String header = null; | |
54 /** | |
55 * Formatted text to print in the footer of each page. | |
56 * <p>"left '\t' center '\t' right"</p> | |
57 * <p>left, center, right = <page> | #CDATA</p> | |
58 * <p>Header and footer are defined as three separate regions for arbitrary | |
59 * text or the page number placeholder <page> | |
60 * (<code>StyledTextPrintOptions.PAGE_TAG</code>). The three regions are | |
61 * left aligned, centered and right aligned. They are separated by a tab | |
62 * character (<code>StyledTextPrintOptions.SEPARATOR</code>). | |
63 */ | |
64 public String footer = null; | |
65 /** | |
66 * Name of the print job. | |
67 */ | |
68 public String jobName = null; | |
69 | |
70 /** | |
71 * Print the text foreground color. Default value is <code>false</code>. | |
72 */ | |
73 public bool printTextForeground = false; | |
74 /** | |
75 * Print the text background color. Default value is <code>false</code>. | |
76 */ | |
77 public bool printTextBackground = false; | |
78 /** | |
79 * Print the font styles. Default value is <code>false</code>. | |
80 */ | |
81 public bool printTextFontStyle = false; | |
82 /** | |
83 * Print the line background color. Default value is <code>false</code>. | |
84 */ | |
85 public bool printLineBackground = false; | |
86 | |
87 /** | |
88 * Print line numbers. Default value is <code>false</code>. | |
89 * | |
90 * @since 3.3 | |
91 */ | |
92 public bool printLineNumbers = false; | |
93 | |
94 /** | |
95 * Labels used for printing line numbers. | |
96 * | |
97 * @since 3.4 | |
98 */ | |
99 public String[] lineLabels = null; | |
100 | |
101 } |