Search in sources :

Example 11 with HtmlWriter

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;
}
Also used : HtmlWriter(cn.cerc.jpage.core.HtmlWriter)

Example 12 with HtmlWriter

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());
}
Also used : HtmlWriter(cn.cerc.jpage.core.HtmlWriter)

Example 13 with HtmlWriter

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());
}
Also used : HtmlWriter(cn.cerc.jpage.core.HtmlWriter)

Example 14 with HtmlWriter

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);
}
Also used : HtmlWriter(cn.cerc.jpage.core.HtmlWriter) Record(cn.cerc.jdb.core.Record) UrlRecord(cn.cerc.jpage.core.UrlRecord) UrlRecord(cn.cerc.jpage.core.UrlRecord) AbstractGridLine(cn.cerc.jpage.grid.lines.AbstractGridLine)

Example 15 with HtmlWriter

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();
}
Also used : HtmlWriter(cn.cerc.jpage.core.HtmlWriter)

Aggregations

HtmlWriter (cn.cerc.jpage.core.HtmlWriter)18 Record (cn.cerc.jdb.core.Record)2 UrlRecord (cn.cerc.jpage.core.UrlRecord)2 AbstractGridLine (cn.cerc.jpage.grid.lines.AbstractGridLine)2 DecimalFormat (java.text.DecimalFormat)2 HtmlContent (cn.cerc.jpage.core.HtmlContent)1 IColumn (cn.cerc.jpage.core.IColumn)1 IField (cn.cerc.jpage.core.IField)1 AbstractField (cn.cerc.jpage.fields.AbstractField)1 DataGrid (cn.cerc.jpage.grid.DataGrid)1 MasterGridLine (cn.cerc.jpage.grid.lines.MasterGridLine)1