Package com.googlecode.wicketwebbeans.model.api

Examples of com.googlecode.wicketwebbeans.model.api.JBean


    public ApiPage()
    {
        TestBean bean = new TestBean();
       
        // Create the meta data
        JBean jbean = new JBean(TestBean.class)
            .tabs(
                new JTab("General").propertyNames("firstName", "lastName", "idNumber"),
                new JTab("Address")
                    .propertyNames("address1", EMPTY, EMPTY,
                                   "address2", EMPTY, EMPTY, "city", "state", "zip")
View Full Code Here


    public LoginPage()
    {
        LoginBean bean = new LoginBean();
       
        // Create the meta data
        JBean jbean = new JBean(LoginBean.class)
            .propertyNames("userName", "password", "action.login");
       
        BeanMetaData meta = new BeanMetaData(bean.getClass(), null, jbean, this, null, false);
        add( new BeanForm("beanForm", bean, meta) );
    }
View Full Code Here

    {
        TestBean bean = new TestBean();
       
        // Create the meta data
        JBeans jbeans = new JBeans(
            new JBean(TestBean.class)
                .columns(1)
                .css("greenBeanBorder")
                .propertyNames("firstName", "lastName", "rows")
                .properties( new JProperty("firstName").css("purpleColor") ),
            new JBean(RowBean.class)
                .css("redBeanBorder")
                .dynamicCss("getRowCss")
                .properties( new JProperty("description").dynamicCss("getDescriptionCss") )
        );
       
View Full Code Here

        /**
         * NOTE: you take actions away from beans metadata
         * and test the contexts with global actions
         */
        jbeans = new JBeans(
            new JBean(TestBean.class)
                .context("nofirstname")
                .actions(
                    new JAction("goToGlobal").ajax(true)
                )
                .properties(
                    new JProperty("action.goToGlobal"),
                    new JProperty("-action.clear"),
                    new JProperty("-action.global"),
                    new JProperty("firstName"),
                    new JProperty("lastName"),
                    new JProperty("operand1"),
                    new JProperty("operand2"),
                    new JProperty("result"),
                    new JProperty("number")
                ),
            new JBean(TestBean.class)
                .context("clearfirstname")
                .actions(
                    new JAction("clear").ajax(true)
                )
                .properties(
                    new JProperty("-action.goToGlobal"),
                    new JProperty("action.clear"),
                    new JProperty("-action.global"),
                    new JProperty("firstName").viewOnly(true),
                    new JProperty("lastName").viewOnly(true),
                    new JProperty("operand1"),
                    new JProperty("operand2"),
                    new JProperty("-result"),
                    new JProperty("-number")
                ),

            new JBean(TestBean.class)
                .context("global")
                .properties(
                    new JProperty("-action.goToGlobal"),
                    new JProperty("-action.clear"),
                    new JProperty("firstName"),
View Full Code Here

     *
     * @param bean
     */
    private JBean processBean(BeanAST bean)
    {
        JBean jbean = new JBean( beanMetaData.getBeanClass() );
        jbean.context( bean.getContext() );
        jbean.extendsContext( bean.getExtendsContext() );
       
        for (ParameterAST param : bean.getParameters()) {
            jbean.add(param.getName(), param.getValuesAsStrings());
        }
       
        // Process actions first.
        for (ParameterAST param : bean.getParameters()) {
            String name = param.getName();
            if (name.equals(BeanMetaData.PARAM_ACTIONS)) {
                jbean.actions( processActions(param.getValues()) );
            }
            else if (name.equals(BeanMetaData.PARAM_PROPS)) {
                jbean.properties( processProps(param.getValues()) );
            }
            else if (param.getName().equals(BeanMetaData.PARAM_TABS)) {
                jbean.tabs( processTabs(param.getValues()) );
            }
            else {
                jbean.add(name, param.getValuesAsStrings());
            }
        }
       
        return jbean;
    }
View Full Code Here

TOP

Related Classes of com.googlecode.wicketwebbeans.model.api.JBean

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.