package cn.cerc.ui.vcl;

import cn.cerc.ui.core.HtmlWriter;
import cn.cerc.ui.parts.UICssComponent;

public class UIUrl extends UICssComponent {
    private String text;
    private String href;
    private String onclick;

    @Override
    public void output(HtmlWriter html) {
        html.print("<a");
        if (this.getCssClass() != null)
            html.print(" class=\"%s\"", this.getCssClass());
        if (this.href != null)
            html.print(" href=\"%s\"", this.href);
        if (this.href != null)
            html.print(" onclick=\"%s\"", this.onclick);
        html.print(">");

        if (this.text != null)
            html.print(this.text);

        html.print("</a>");
    }

    public String getText() {
        return text;
    }

    public UIUrl setText(String text) {
        this.text = text;
        return this;
    }

    public String getHref() {
        return href;
    }

    public UIUrl setHref(String href) {
        this.href = href;
        return this;
    }

    public UIUrl setHref(String href, Object... args) {
        this.href = String.format(href, args);
        return this;
    }

    public String getOnclick() {
        return onclick;
    }

    public void setOnclick(String onclick) {
        this.onclick = onclick;
    }

}

@@ -53,16 +53,53 @@
 Writer;%0A
+import cn.cerc.ui.parts.UIComponent;%0A
 import c
@@ -254,16 +254,128 @@
 click;%0A%0A
+    public UIUrl() %7B%0A        super();%0A    %7D%0A%0A    public UIUrl(UIComponent owner) %7B%0A        super(owner);%0A    %7D%0A%0A
     @Ove
@@ -1274,32 +1274,255 @@
 rn this;%0A    %7D%0A%0A
+    public UIUrl setUrl(String href) %7B%0A        this.href = href;%0A        return this;%0A    %7D%0A%0A    public UIUrl setUrl(String href, Object... args) %7B%0A        this.href = String.format(href, args);%0A        return this;%0A    %7D%0A%0A
     public Strin

Update UIUrl.java