Package org.apache.click.control

Examples of org.apache.click.control.Panel


        // Select panel specified by tabPanelIndex if defined
        String tabPanelIndex = getContext().getRequestParameter("tabPanelIndex");
        if (NumberUtils.isNumber(tabPanelIndex)) {
            int tabIndex = Integer.parseInt(tabPanelIndex);
            if (tabIndex >= 0 && tabIndex < getPanels().size()) {
                Panel targetPanel = (Panel) getPanels().get(tabIndex);
                if (!targetPanel.isDisabled()) {
                    // Deactive panels
                    for (Panel panel : getPanels()) {
                        panel.setActive(false);
                    }

                    setActivePanel(targetPanel);
                }
            }
        } else {
            // Explicitly bind the link to the request and check if the
            // link was clicked
            ActionLink link = getTabLink();
            link.bindRequestValue();
            if (link.isClicked()) {

                // Check which panel user selected and set that Panel as active
                for (int i = 0; i < getPanels().size(); i++) {
                    Panel panel = (Panel) getPanels().get(i);

                    // Deactivate panel
                    panel.setActive(false);

                    if (link.getValue().equals(panel.getName())
                        && !panel.isDisabled()) {

                        setActivePanel(panel);
                    }
                }
            }
View Full Code Here


        if (hasControls()) {
            for (int i = 0, size = getControls().size(); i < size; i++) {
                Control control = (Control) getControls().get(i);

                if (control instanceof Panel) {
                    Panel panel = (Panel) control;
                    if (panel == getActivePanel()) {
                        String htmlImports = panel.getHtmlImports();
                        if (htmlImports != null) {
                            buffer.append(htmlImports);
                        }
                    }
View Full Code Here

        // Select panel specified by tabPanelIndex if defined
        String tabPanelIndex = getContext().getRequestParameter("tabPanelIndex");
        if (NumberUtils.isNumber(tabPanelIndex)) {
            int tabIndex = Integer.parseInt(tabPanelIndex);
            if (tabIndex >= 0 && tabIndex < getPanels().size()) {
                Panel panel = (Panel) getPanels().get(tabIndex);
                if (!panel.isDisabled()) {
                    setActivePanel(panel);
                }
            }
        } else {
            // Explicitly bind the tabLink to the request and check if the
            // tabLink was clicked
            tabLink.bindRequestValue();
            if (tabLink.isClicked()) {

                // Check which panel user selected and set that Panel as active
                for (int i = 0; i < getPanels().size(); i++) {
                    Panel panel = (Panel) getPanels().get(i);

                    if (tabLink.getValue().equals(panel.getName())
                        && !panel.isDisabled()) {

                        setActivePanel(panel);
                    }
                }
            }
View Full Code Here

    @Resource(name="customerService")
    private CustomerService customerService;

    public ListPanelDemo() {
        listPanel.add(new Panel("panel1", "/panel/customersPanel1.htm"));
        listPanel.add(new Panel("panel2", "/panel/customersPanel2.htm"));
        listPanel.add(new Panel("panel3", "/panel/customersPanel3.htm"));
    }
View Full Code Here

    @Resource(name="customerService")
    private CustomerService customerService;

    public TabbedPanelDemo() {
        Panel panel1 = new Panel("panel1", "panel/customersPanel1.htm");
        panel1.setLabel("The First Panel");
        tabbedPanel.add(panel1);

        Panel panel2 = new Panel("panel2", "panel/customersPanel2.htm");
        panel2.setLabel("The Second Panel");
        tabbedPanel.add(panel2);

        Panel panel3 = new Panel("panel3", "panel/customersPanel3.htm");
        panel3.setLabel("The Third Panel");
        tabbedPanel.add(panel3);

        // Register a listener that is notified when a different panel is selected.
        tabbedPanel.setTabListener(this, "onTabClick");
    }
View Full Code Here

    @Override
    public Control replace(Control currentControl, Control newControl) {
        super.replace(currentControl, newControl);

        if (currentControl instanceof Panel) {
            Panel currentPanel = (Panel) currentControl;
            if (currentPanel == getActivePanel()) {
                setActivePanel((Panel) newControl);
            }
        }
        return newControl;
View Full Code Here

     * @param control the control to process
     */
    public void processControl(Control control) {
        // Don't process inactive panels
        if (control instanceof Panel) {
            Panel panel = (Panel) control;
            if (!panel.isActive()) {
                return;
            }
        }

        processHeadElements(control.getHeadElements());
View Full Code Here

     */
    public Object getState() {
        Object[] panelState = new Object[2];
        boolean hasState = false;

        Panel localActivePanel = getActivePanel();
        if (localActivePanel != null) {
            String activePanelName = localActivePanel.getName();
            hasState = true;
            panelState[0] = activePanelName;
        }

        Object tabLinkState = getTabLink().getState();
View Full Code Here

        if (panelState[0] != null) {

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

        if (panelState[1] != null) {
View Full Code Here

        // Select panel specified by tabPanelIndex if defined
        String tabPanelIndex = getContext().getRequestParameter("tabPanelIndex");
        if (NumberUtils.isNumber(tabPanelIndex)) {
            int tabIndex = Integer.parseInt(tabPanelIndex);
            if (tabIndex >= 0 && tabIndex < getPanels().size()) {
                Panel targetPanel = getPanels().get(tabIndex);
                if (!targetPanel.isDisabled()) {
                    // Deactivate panels
                    for (Panel panel : getPanels()) {
                        panel.setActive(false);
                    }

                    setActivePanel(targetPanel);
                }
            }
        } else {
            // Explicitly bind the link to the request and check if the
            // link was clicked
            ActionLink link = getTabLink();
            link.bindRequestValue();
            if (link.isClicked()) {

                // Check which panel user selected and set that Panel as active
                for (int i = 0; i < getPanels().size(); i++) {
                    Panel panel = getPanels().get(i);

                    // Deactivate panel
                    panel.setActive(false);

                    if (link.getValue().equals(panel.getName())
                        && !panel.isDisabled()) {

                        setActivePanel(panel);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.click.control.Panel

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.