Package org.apache.click

Examples of org.apache.click.Control


     * if the parent FieldSet or Form is readonly.
     *
     * @return true if the Field is a readonly
     */
    public boolean isReadonly() {
        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.isReadonly()) {
                    return true;
                } else {
View Full Code Here


    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(controlName);

            // 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

        if (currentControl == newControl) {
            return newControl;
        }

        int controlIndex = getControls().indexOf(currentControl);
        Control result = ContainerUtils.replace(this, currentControl, newControl,
            controlIndex, getControlMap());

        String controlName = newControl.getName();
        if (controlName != null) {
            // If controls name is set, add control to the model
View Full Code Here

        Object[] panelState = (Object[]) state;

        if (panelState[0] != null) {

            String activePanelName = (String) panelState[0];
               Control control = getControlMap().get(activePanelName);
                if (control instanceof Panel) {
                    Panel localActivePanel = (Panel) control;
                    setActivePanel(localActivePanel);
                }
            }
View Full Code Here

    @Override
    public void onInit() {
        initActivePanel();

        for (int i = 0, size = getControls().size(); i < size; i++) {
            Control control = getControls().get(i);
            if (control instanceof Panel) {
                if (control == getActivePanel()) {
                    control.onInit();
                }
            } else {
                control.onInit();
            }
        }
    }
View Full Code Here

    @Override
    public boolean onProcess() {
        boolean continueProcessing = true;

        for (int i = 0, size = getControls().size(); i < size; i++) {
            Control control = getControls().get(i);
            if (control instanceof Panel) {
                if (control == getActivePanel()) {
                    if (!control.onProcess()) {
                        continueProcessing = false;
                    }
                }
            } else {
                if (!control.onProcess()) {
                    continueProcessing = false;
                }
            }
        }
        if (getTabLink().isClicked()) {
View Full Code Here

     * @see org.apache.click.Control#onRender()
     */
    @Override
    public void onRender() {
        for (int i = 0, size = getControls().size(); i < size; i++) {
            Control control = getControls().get(i);
            if (control instanceof Panel) {
                if (control == getActivePanel()) {
                    control.onRender();
                }
            } else {
                control.onRender();
            }
        }
    }
View Full Code Here

     * matching name
     * @param name the name of the control to find
     * @return the control which name matched the given name
     */
    public static Control findControlByName(Container container, String name) {
        Control control = container.getControl(name);

        if (control != null) {
            return control;

        } else {
            for (Control childControl : container.getControls()) {

                if (childControl instanceof Container) {
                    Container childContainer = (Container) childControl;
                    Control found = findControlByName(childContainer, name);
                    if (found != null) {
                        return found;
                    }
                }
            }
View Full Code Here

     * matching name
     * @param name the name of the control to find
     * @return the control which name matched the given name
     */
    public static Control findControlByName(Container container, String name) {
        Control control = container.getControl(name);

        if (control != null) {
            return control;

        } else {
            for (Control childControl : container.getControls()) {

                if (childControl instanceof Container) {
                    Container childContainer = (Container) childControl;
                    Control found = findControlByName(childContainer, name);
                    if (found != null) {
                        return found;
                    }
                }
            }
View Full Code Here

        if (isFormSubmission()) {

            if (hasControls()) {
                for (Iterator it = getControls().iterator(); it.hasNext();) {
                    Control control = (Control) it.next();
                    String controlName = control.getName();
                    if (controlName == null || !controlName.startsWith(SUBMIT_CHECK)) {

                        if (!control.onProcess()) {
                            continueProcessing = false;
                        }
                    }
                }
            }
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.