Package org.apache.click

Examples of org.apache.click.Page


     * CLK-666
     */
    public void testReplace() {
        MockContext.initContext();

        Page page = new Page();
        TabbedPanel panel = new TabbedPanel("panel");
        page.addControl(panel);

        // Add two panels named child1 and child2
        Panel child1 = new Panel("child1");
        Panel child2 = new Panel("child2");
        panel.add(child1);
View Full Code Here


                    if (parent == null) {
                        return control.getMessages();
                    }

                } else if (parent instanceof Page) {
                    Page page = (Page) parent;
                    return page.getMessages();

                } else if (parent != null) {
                    // Unknown parent class
                    return Collections.emptyMap();
                }
View Full Code Here

                    if (parent == null) {
                        return message;
                    }

                } else if (parent instanceof Page) {
                    Page page = (Page) parent;
                    if (page.getMessages().containsKey(name)) {
                        message = page.getMessages().get(name);
                    }
                    return message;

                } else if (parent != null) {
                    // Unknown parent class
View Full Code Here

     * processing.
     *
     * @return false to abort any further processing
     */
    public boolean onClick() {
        Page page = ClickUtils.getParentPage(this);
        if (page == null) {
            throw new RuntimeException("parent page not available");
        }
        if (pageClass == null) {
            throw  new RuntimeException("target pageClass is not defined");
        }
        page.setRedirect(pageClass);
        return false;
    }
View Full Code Here

     * CLK-453
     */
    public void testGetHeadElements() {
        MockContext.initContext();

        Page page = new Page();
        PageImports pageImports = new PageImports(page);

        // Check imports using an internal Form Control
        FormTable table = new FormTable("table");

        pageImports.processControl(table);
        List<Element> headElements = pageImports.getHeadElements();
        List<Element> jsElements = pageImports.getJsElements();

        assertTrue(headElements.get(0).toString().contains("/table.css"));
        assertTrue(headElements.get(1).toString().contains("/control.css"));
        assertTrue(jsElements.get(0).toString().contains("/control.js"));


        // Check imports using an external Form Control
        page = new Page();
        pageImports = new PageImports(page);

        Form form = new Form("form");
        table = new FormTable("table", form);
        form.add(table);
View Full Code Here

    }

    public void testI18N() {
        MockContext.initContext();

        Page page = new Page();
        Menu rootMenu = new MyMenu("root");
        page.addControl(rootMenu);

        Menu menu = new MyMenu("mymenu");
        rootMenu.add(menu);

        assertEquals("Root Label", menu.getLabel());
View Full Code Here

     */
    @Override
    protected Page newPageInstance(String path, Class<? extends Page> pageClass,
            HttpServletRequest request) throws Exception {

        Page page = null;

        String beanName = toBeanName(pageClass);

        if (getApplicationContext().containsBean(beanName)) {
            page = (Page) getApplicationContext().getBean(beanName);
View Full Code Here

TOP

Related Classes of org.apache.click.Page

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.