net.sf.dynamicreports.report.base.component.DRTextField Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dynamicreports-core Show documentation
Show all versions of dynamicreports-core Show documentation
DynamicReports is an open source Java reporting library based on JasperReports. It allows to create dynamic report designs and it doesn't need a visual report designer.
You can very quickly create reports and produce documents that can be displayed, printed or exported into many popular formats such as PDF, Excel, Word and others.
/**
* DynamicReports - Free Java reporting library for creating reports dynamically
*
* Copyright (C) 2010 - 2016 Ricardo Mariaca
* http://www.dynamicreports.org
*
* This file is part of DynamicReports.
*
* DynamicReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DynamicReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with DynamicReports. If not, see .
*/
package net.sf.dynamicreports.report.base.component;
import org.apache.commons.lang3.Validate;
import net.sf.dynamicreports.report.base.DRGroup;
import net.sf.dynamicreports.report.constant.Constants;
import net.sf.dynamicreports.report.constant.Evaluation;
import net.sf.dynamicreports.report.constant.HorizontalTextAlignment;
import net.sf.dynamicreports.report.constant.Markup;
import net.sf.dynamicreports.report.definition.component.DRITextField;
import net.sf.dynamicreports.report.definition.datatype.DRIDataType;
import net.sf.dynamicreports.report.definition.expression.DRIExpression;
import net.sf.dynamicreports.report.definition.expression.DRIValueFormatter;
/**
* @author Ricardo Mariaca ([email protected])
*/
public class DRTextField extends DRHyperLinkComponent implements DRITextField {
private static final long serialVersionUID = Constants.SERIAL_VERSION_UID;
private DRIExpression valueExpression;
private String pattern;
private DRIExpression patternExpression;
private HorizontalTextAlignment horizontalTextAlignment;
private DRIValueFormatter valueFormatter;
private DRIDataType dataType;
private Integer columns;
private Integer rows;
private Evaluation evaluationTime;
private DRGroup evaluationGroup;
private Markup markup;
private Boolean stretchWithOverflow;
private Boolean printRepeatedValues;
@Override
public DRIExpression getValueExpression() {
return valueExpression;
}
public void setValueExpression(DRIExpression valueExpression) {
Validate.notNull(valueExpression, "valueExpression must not be null");
this.valueExpression = valueExpression;
}
@Override
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
@Override
public DRIExpression getPatternExpression() {
return patternExpression;
}
public void setPatternExpression(DRIExpression patternExpression) {
this.patternExpression = patternExpression;
}
@Override
public HorizontalTextAlignment getHorizontalTextAlignment() {
return horizontalTextAlignment;
}
public void setHorizontalTextAlignment(HorizontalTextAlignment horizontalTextAlignment) {
this.horizontalTextAlignment = horizontalTextAlignment;
}
@Override
public DRIValueFormatter getValueFormatter() {
return valueFormatter;
}
public void setValueFormatter(DRIValueFormatter valueFormatter) {
this.valueFormatter = valueFormatter;
}
@Override
public DRIDataType getDataType() {
return dataType;
}
public void setDataType(DRIDataType dataType) {
this.dataType = dataType;
}
/**
* Returns the number of columns.
*
* @return the number of columns >= 0
*/
@Override
public Integer getColumns() {
return columns;
}
/**
* This method is used to define the width of a column.
* The width is set to the columns
multiplied by width of the
* character m for the font used
*
* @param columns the number of columns >= 0
* @exception IllegalArgumentException if columns
is < 0
*/
public void setColumns(Integer columns) {
if (columns != null) {
Validate.isTrue(columns >= 0, "columns must be >= 0");
}
this.columns = columns;
}
/**
* Returns the number of rows.
*
* @return the number of rows >= 0
*/
@Override
public Integer getRows() {
return rows;
}
/**
* This method is used to define the height of a column.
* The height is set to the rows
multiplied by height of the font
*
* @param rows the number of rows >= 0
* @exception IllegalArgumentException if rows
is < 0
*/
public void setRows(Integer rows) {
if (rows != null) {
Validate.isTrue(rows >= 0, "rows must be >= 0");
}
this.rows = rows;
}
@Override
public Evaluation getEvaluationTime() {
return evaluationTime;
}
public void setEvaluationTime(Evaluation evaluationTime) {
this.evaluationTime = evaluationTime;
}
@Override
public DRGroup getEvaluationGroup() {
return evaluationGroup;
}
public void setEvaluationGroup(DRGroup evaluationGroup) {
this.evaluationGroup = evaluationGroup;
}
@Override
public Markup getMarkup() {
return markup;
}
public void setMarkup(Markup markup) {
this.markup = markup;
}
@Override
public Boolean getStretchWithOverflow() {
return stretchWithOverflow;
}
public void setStretchWithOverflow(Boolean stretchWithOverflow) {
this.stretchWithOverflow = stretchWithOverflow;
}
@Override
public Boolean getPrintRepeatedValues() {
return printRepeatedValues;
}
public void setPrintRepeatedValues(Boolean printRepeatedValues) {
this.printRepeatedValues = printRepeatedValues;
}
}