KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > JRTextField


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 package net.sf.jasperreports.engine;
29
30 import net.sf.jasperreports.engine.util.DefaultFormatFactory;
31
32 //import java.text.Format;
33

34
35 /**
36  * An abstract representation of a report static text. It provides functionality for static texts.
37  * @author Teodor Danciu (teodord@users.sourceforge.net)
38  * @version $Id: JRTextField.java 1489 2006-11-14 22:38:10 +0200 (Tue, 14 Nov 2006) teodord $
39  */

40 public interface JRTextField extends JRTextElement, JRAnchor, JRHyperlink
41 {
42
43     /**
44      * Used in the date pattern to specify the default style.
45      * @see java.text.DateFormat#DEFAULT
46      * @deprecated replaced by {@link DefaultFormatFactory#STANDARD_DATE_FORMAT_DEFAULT DefaultFormatFactory.STANDARD_DATE_FORMAT_DEFAULT}
47      */

48     public static final String JavaDoc STANDARD_DATE_FORMAT_DEFAULT = DefaultFormatFactory.STANDARD_DATE_FORMAT_DEFAULT;
49
50     /**
51      * Used in the date pattern to specify the short style.
52      * @see java.text.DateFormat#SHORT
53      * @deprecated replaced by {@link DefaultFormatFactory#STANDARD_DATE_FORMAT_SHORT DefaultFormatFactory.STANDARD_DATE_FORMAT_SHORT}
54      */

55     public static final String JavaDoc STANDARD_DATE_FORMAT_SHORT = DefaultFormatFactory.STANDARD_DATE_FORMAT_SHORT;
56
57     /**
58      * Used in the date pattern to specify the medium style.
59      * @see java.text.DateFormat#MEDIUM
60      * @deprecated replaced by {@link DefaultFormatFactory#STANDARD_DATE_FORMAT_MEDIUM DefaultFormatFactory.STANDARD_DATE_FORMAT_MEDIUM}
61      */

62     public static final String JavaDoc STANDARD_DATE_FORMAT_MEDIUM = DefaultFormatFactory.STANDARD_DATE_FORMAT_MEDIUM;
63
64     /**
65      * Used in the date pattern to specify the long style.
66      * @see java.text.DateFormat#LONG
67      * @deprecated replaced by {@link DefaultFormatFactory#STANDARD_DATE_FORMAT_LONG DefaultFormatFactory.STANDARD_DATE_FORMAT_LONG}
68      */

69     public static final String JavaDoc STANDARD_DATE_FORMAT_LONG = DefaultFormatFactory.STANDARD_DATE_FORMAT_LONG;
70
71     /**
72      * Used in the date pattern to specify the full style.
73      * @see java.text.DateFormat#FULL
74      * @deprecated replaced by {@link DefaultFormatFactory#STANDARD_DATE_FORMAT_FULL DefaultFormatFactory.STANDARD_DATE_FORMAT_FULL}
75      */

76     public static final String JavaDoc STANDARD_DATE_FORMAT_FULL = DefaultFormatFactory.STANDARD_DATE_FORMAT_FULL;
77
78     /**
79      * Used in the date pattern to specify that the date or time should not be included.
80      * @deprecated replaced by {@link DefaultFormatFactory#STANDARD_DATE_FORMAT_HIDE DefaultFormatFactory.STANDARD_DATE_FORMAT_HIDE}
81      */

82     public static final String JavaDoc STANDARD_DATE_FORMAT_HIDE = DefaultFormatFactory.STANDARD_DATE_FORMAT_HIDE;
83
84     /**
85      * Used in the date format pattern to separate the date and time styles.
86      * @deprecated replaced by {@link DefaultFormatFactory#STANDARD_DATE_FORMAT_SEPARATOR DefaultFormatFactory.STANDARD_DATE_FORMAT_SEPARATOR}
87      */

88     public static final String JavaDoc STANDARD_DATE_FORMAT_SEPARATOR = DefaultFormatFactory.STANDARD_DATE_FORMAT_SEPARATOR;
89
90     
91     /**
92      * Specifies whether the text field will stretch vertically if its text does not fit in one line.
93      * @return true if the text field will stretch vertically, false otherwise
94      */

95     public boolean isStretchWithOverflow();
96
97     /**
98      * Set to true if the text field should stretch vertically if its text does not fit in one line.
99      */

100     public void setStretchWithOverflow(boolean isStretchWithOverflow);
101         
102     /**
103      * Gets the evaluation time for this text field.
104      * @return one of the evaluation time constants in {@link JRExpression}
105      */

106     public byte getEvaluationTime();
107         
108     /**
109      * Gets the pattern used for this text field. The pattern will be used in a <tt>SimpleDateFormat</tt> for dates
110      * and a <tt>DecimalFormat</tt> for numeric text fields. The pattern format must follow one of these two classes
111      * formatting rules, as specified in the JDK API docs.
112      * @return a string containing the pattern.
113      */

114     public String JavaDoc getPattern();
115         
116     public String JavaDoc getOwnPattern();
117
118     /**
119      * Sets the pattern used for this text field. The pattern will be used in a <tt>SimpleDateFormat</tt> for dates
120      * and a <tt>DecimalFormat</tt> for numeric text fields. The pattern format must follow one of these two classes
121      * formatting rules, as specified in the JDK API docs. If the pattern is incorrect, the exception thrown by formatter
122      * classes will be rethrown by the JasperReports fill engine.
123      */

124     public void setPattern(String JavaDoc pattern);
125         
126     /**
127      * Indicates whether an empty string will be displayed if the field's expression evaluates to <code>null</code>.
128      * @return true if an empty string will be displayed instead of null values, false otherwise
129      */

130     public boolean isBlankWhenNull();
131
132     public Boolean JavaDoc isOwnBlankWhenNull();
133
134     /**
135      * Specifies whether an empty string sholuld be displayed if the field's expression evaluates to <code>null</code>.
136      * @param isBlank true if an empty string will be displayed instead of null values, false otherwise
137      */

138     public void setBlankWhenNull(boolean isBlank);
139
140     public void setBlankWhenNull(Boolean JavaDoc isBlank);
141
142     /**
143      * Gets the evaluation group for this text field. Used only when evaluation time is group.
144      * @see JRExpression#EVALUATION_TIME_GROUP
145      */

146     public JRGroup getEvaluationGroup();
147         
148     /**
149      * Gets the expression for this field. The result obtained after evaluating this expression will be dispayed as
150      * the field text.
151      */

152     public JRExpression getExpression();
153         
154
155 }
156
Popular Tags