slidertag.java

来自「tbuy1.1.5是在netbeans环境下用JSF技术编写的一个论坛tbuy1」· Java 代码 · 共 110 行

JAVA
110
字号
/* * SliderTag.java *  * Created on 2007-9-25, 7:38:35 *  * To change this template, choose Tools | Templates * and open the template in the editor. */package biz.tbuy.common.components.test;import javax.faces.application.Application;import javax.faces.component.UIComponent;import javax.faces.context.FacesContext;import javax.faces.el.ValueBinding;import javax.faces.webapp.UIComponentTag;/** * * @author Administrator */public class SliderTag extends UIComponentTag{    String For = null;    String maxval = null;    String horizontal = null;    String length = null;    public SliderTag() {    }    public String getComponentType() {        return "SliderInput";    }    public String getRendererType() {        return null;    }    @Override    protected void setProperties(UIComponent ui) {        super.setProperties(ui);        if (For != null) {            if (isValueReference(For)) {                FacesContext fc = FacesContext.getCurrentInstance();                Application app = fc.getApplication();                ValueBinding vb = app.createValueBinding(For);                ui.setValueBinding("for", vb);            } else {                ui.getAttributes().put("for", For);            }        }        if (maxval != null) {            if (isValueReference(maxval)) {                FacesContext fc = FacesContext.getCurrentInstance();                Application app = fc.getApplication();                ValueBinding vb = app.createValueBinding(maxval);                ui.setValueBinding("maxval", vb);            } else {                ui.getAttributes().put("maxval", maxval);            }        }                if (horizontal != null) {            if (isValueReference(horizontal)) {                FacesContext fc = FacesContext.getCurrentInstance();                Application app = fc.getApplication();                ValueBinding vb = app.createValueBinding(horizontal);                ui.setValueBinding("horizontal", vb);            } else {                ui.getAttributes().put("horizontal", horizontal);            }        }        if (length != null) {            if (isValueReference(length)) {                FacesContext fc = FacesContext.getCurrentInstance();                Application app = fc.getApplication();                ValueBinding vb = app.createValueBinding(length);                ui.setValueBinding("length", vb);            } else {                ui.getAttributes().put("length", length);            }        }    }        public void setFor(String For) {        this.For = For;    }        public void setMaxval(String maxval) {        this.maxval = maxval;    }        public void setHorizontal(String horizontal) {        this.horizontal = horizontal;    }        public void setLength(String length) {        this.length = length;    }        @Override    public void release() {        super.release();        For = null;        maxval = null;        horizontal = null;        length = null;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?