use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class BooleanField method getText.
@Override
public String getText(Record dataSet) {
if (dataSet == null)
return null;
if (buildText != null) {
HtmlWriter html = new HtmlWriter();
buildText.outputText(dataSet, html);
return html.toString();
}
return dataSet.getBoolean(field) ? trueText : falseText;
}
use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class ButtonField method getText.
@Override
public String getText(Record dataSet) {
if (dataSet == null)
return null;
if (buildText != null) {
HtmlWriter html = new HtmlWriter();
buildText.outputText(dataSet, html);
return html.toString();
}
return dataSet.getString(getField());
}
use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class DateTimeField method getText.
@Override
public String getText(Record dataSet) {
if (dataSet == null)
return null;
if (buildText != null) {
HtmlWriter html = new HtmlWriter();
buildText.outputText(dataSet, html);
return html.toString();
}
return dataSet.getString(getField());
}
use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class DoubleField method format.
@Override
public String format(Object value) {
if (!(value instanceof Record))
return value.toString();
Record ds = (Record) value;
if (this.isReadonly()) {
if (buildUrl != null) {
HtmlWriter html = new HtmlWriter();
UrlRecord url = new UrlRecord();
buildUrl.buildUrl(ds, url);
if (!"".equals(url.getUrl())) {
html.print("<a href=\"%s\"", url.getUrl());
if (url.getTitle() != null) {
html.print(" title=\"%s\"", url.getTitle());
}
if (url.getTarget() != null) {
html.print(" target=\"%s\"", url.getTarget());
}
html.println(">%s</a>", getText(ds));
} else
html.println(getText(ds));
return html.toString();
} else
return getText(ds);
}
if (!(this.getOwner() instanceof AbstractGridLine))
return getText(ds);
return getEditor().format(ds);
}
use of cn.cerc.jpage.core.HtmlWriter in project summer-mis by cn-cerc.
the class ItField method getText.
@Override
public String getText(Record dataSet) {
if (dataSet == null)
return null;
if (buildText != null) {
HtmlWriter html = new HtmlWriter();
buildText.outputText(dataSet, html);
return html.toString();
}
return "" + dataSource.getDataSet().getRecNo();
}
Aggregations