Package org.apache.click

Examples of org.apache.click.Control


    public Control insert(Control control, int index) {
        // Check if panel already contains the control
        String controlName = control.getName();
        if (controlName != null) {
            // Check if container already contains the control
            Control currentControl = getControlMap().get(control.getName());

            // If container already contains the control do a replace
            if (currentControl != null) {

                // Current control and new control are referencing the same object
View Full Code Here


     */
    @Override
    public void onDestroy() {
        if (hasControls()) {
            for (int i = 0, size = getControls().size(); i < size; i++) {
                Control control = getControls().get(i);
                try {
                    control.onDestroy();
                } catch (Throwable t) {
                    ClickUtils.getLogService().error("onDestroy error", t);
                }
            }
        }
View Full Code Here

    @Override
    public void onInit() {
        super.onInit();
        if (hasControls()) {
            for (int i = 0, size = getControls().size(); i < size; i++) {
                Control control = getControls().get(i);
                control.onInit();
            }
        }
    }
View Full Code Here

     */
    @Override
    public void onRender() {
        if (hasControls()) {
            for (int i = 0, size = getControls().size(); i < size; i++) {
                Control control = getControls().get(i);
                control.onRender();
            }
        }
    }
View Full Code Here

     * @param buffer the buffer to append the output to
     */
    protected void renderChildren(HtmlStringBuffer buffer) {
        if (hasControls()) {
            for (int i = 0; i < getControls().size(); i++) {
                Control control = getControls().get(i);

                int before = buffer.length();
                control.render(buffer);
                int after = buffer.length();
                if (before != after) {
                    buffer.append("\n");
                }
            }
View Full Code Here

     * @param buffer the buffer to append the output to
     */
    protected void renderChildren(HtmlStringBuffer buffer) {
        if (hasControls()) {
            for (int i = 0; i < getControls().size(); i++) {
                Control control = getControls().get(i);

                int before = buffer.length();
                control.render(buffer);

                int after = buffer.length();
                if (before != after) {
                    buffer.append("\n");
                }
View Full Code Here

                    "'control' element missing 'classname' attribute.";
                throw new RuntimeException(msg);
            }

            Class deployClass = ClickUtils.classForName(classname);
            Control control = (Control) deployClass.newInstance();

            control.onDeploy(servletContext);
        }
    }
View Full Code Here

     * @param container the container which Fields and Links to bind
     * @param context the request context
     */
    private static void bind(Container container, Context context) {
        for (int i = 0; i < container.getControls().size(); i++) {
            Control control = container.getControls().get(i);
            if (control instanceof Container) {
                // Include fields but skip fieldSets
                if (control instanceof Field) {
                    Field field = (Field) control;
                    bindField(field, context);
View Full Code Here

     * otherwise
     */
    private static boolean bindAndValidate(Container container, Context context) {
        boolean valid = true;
        for (int i = 0; i < container.getControls().size(); i++) {
            Control control = container.getControls().get(i);
            if (control instanceof Container) {

                // Bind and validate fields only
                if (control instanceof Field) {
                    if (!bindAndValidate((Field) control, context)) {
View Full Code Here

     * @see #setDisabled(boolean)
     *
     * @return true if the Field is disabled
     */
    public boolean isDisabled() {
        Control control = this;

        // Check parents for instances of either FieldSet or Form
        while (control.getParent() != null && !(control.getParent() instanceof Page)) {
            control = (Control) control.getParent();
            if (control instanceof FieldSet) {
                FieldSet fieldSet = (FieldSet) control;
                if (fieldSet.isDisabled()) {
                    return true;
                } else {
View Full Code Here

TOP

Related Classes of org.apache.click.Control

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.