package cn.cerc.ui.core;

import java.lang.reflect.InvocationTargetException;

import cn.cerc.ui.parts.UIComponent;
import cn.cerc.ui.parts.UICssComponent;

public class UICustomComponent extends UICssComponent {
    
    public UICustomComponent() {
        super();
    }

    public UICustomComponent(UIComponent owner) {
        super(owner);
    }

    @Override
    public void output(HtmlWriter html) {
        for (Component component : this.getComponents()) {
            if (component instanceof UIComponent) {
                ((UIComponent) component).output(html);
            }
        }
    }

    @Deprecated
    public <T> T create(Class<T> clazz) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
        T obj = clazz.getDeclaredConstructor().newInstance();
        if (!(obj instanceof Component)) {
            throw new RuntimeException("仅支持Component及其子数，不支持创建类型: " + clazz.getName());
        }
        Component item = (Component) obj;
        item.setOwner(this);
        return obj;
    }

}

@@ -112,48 +112,8 @@
 ent;
-%0Aimport cn.cerc.ui.parts.UICssComponent;
 %0A%0Apu
@@ -156,11 +156,8 @@
  UIC
-ssC
 ompo
@@ -163,16 +163,78 @@
 onent %7B%0A
+    protected String cssClass;%0A    protected String cssStyle;%0A
     %0A   
@@ -1128,10 +1128,596 @@
 %0A    %7D%0A%0A
+    public String getCssClass() %7B%0A        return cssClass;%0A    %7D%0A%0A    @Deprecated%0A    public void setCssClass(String cssClass) %7B%0A        this.cssClass = cssClass;%0A    %7D%0A%0A    public String getCssStyle() %7B%0A        return cssStyle;%0A    %7D%0A%0A    @Deprecated%0A    public void setCssStyle(String cssStyle) %7B%0A        this.cssStyle = cssStyle;%0A    %7D%0A%0A    protected void outputCss(HtmlWriter html) %7B%0A        if (this.cssClass != null) %7B%0A            html.print(%22 class='%25s'%22, cssClass);%0A        %7D%0A        if (this.cssStyle != null) %7B%0A            html.print(%22 style='%25s'%22, cssStyle);%0A        %7D%0A    %7D%0A
 %7D%0A

Update UICustomComponent.java