Examples of ComponentBean


Examples of org.apache.shale.clay.config.beans.ComponentBean

        }
        AttributeBean attributeBean = clayContext.getAttribute();
        if (attributeBean == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.attributeBean"));
        }
        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.componentBean"));
        }
        FacesContext facesContext = clayContext.getFacesContext();
        if (facesContext == null) {

Examples of org.apache.shale.clay.config.beans.ComponentBean

        }
        AttributeBean attributeBean = clayContext.getAttribute();
        if (attributeBean == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.attributeBean"));
        }
        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.childComponent"));
        }
        FacesContext facesContext = clayContext.getFacesContext();
        if (facesContext == null) {

Examples of org.apache.shale.clay.config.beans.ComponentBean

        }
        Object child = clayContext.getChild();
        if (child == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.childComponent"));
        }
        ComponentBean displayElement = clayContext.getDisplayElement();
        if (displayElement == null) {
            throw new NullPointerException(getMessages().getMessage("clay.null.componentBean"));
        }
        FacesContext facesContext = clayContext.getFacesContext();
        if (facesContext == null) {

Examples of org.apache.shale.clay.config.beans.ComponentBean

    public void testDesigntimeOn() {
        ((ComponentConfigBean) standardConfigBean).setDesigntime(true);      
        loadConfigFiles(null, null);
       
        ComponentBean bean = standardConfigBean.getElement("clay");
        assertNotNull(bean);
       
        String description = bean.getDescription();
        assertNotNull(description);
       
        assertTrue(description.startsWith("This component builds a sub component tree and attaches"));
       
        AttributeBean attr = bean.getAttribute("managedBeanName");
        assertNotNull(attr);
       
        description = attr.getDescription();
        assertEquals("A symbol that is used to alias the bound backing bean.", description);

       
        bean = standardConfigBean.getElement("baseHtml");
        assertNotNull(bean);
       
        description = bean.getDescription();
        assertNotNull(description);
       
        assertTrue(description.startsWith("Abstract base component definition"));
       
        SymbolBean symbol = (SymbolBean) bean.getSymbols().get("@class");
        assertNotNull(symbol);
       
        description = symbol.getDescription();
        assertNotNull(description);
       

Examples of org.apache.shale.clay.config.beans.ComponentBean

   
    public void testDesigntimeOff() {
        ((ComponentConfigBean) standardConfigBean).setDesigntime(false);      
        loadConfigFiles(null, null);
       
        ComponentBean bean = standardConfigBean.getElement("clay");
        assertNotNull(bean);
       
        String description = bean.getDescription();
        assertNull(description);
              
        AttributeBean attr = bean.getAttribute("managedBeanName");
        assertNotNull(attr);
       
        description = attr.getDescription();
        assertNull(description);

        bean = standardConfigBean.getElement("baseHtml");
        assertNotNull(bean);
       
        description = bean.getDescription();
        assertNull(description);

        SymbolBean symbol = (SymbolBean) bean.getSymbols().get("@class");
        assertNotNull(symbol);
       
        description = symbol.getDescription();
        assertNull(description);
       

Examples of org.apache.shale.clay.config.beans.ComponentBean

    public void testDesigntimeOnInheritance() {
        ((ComponentConfigBean) standardConfigBean).setDesigntime(true);      
        loadConfigFiles(null, null);

        ComponentBean bean1 = standardConfigBean.getElement("f:converter");
        assertNotNull(bean1);
       
        assertNotNull(bean1.getDescription());
       
        ComponentBean bean2 = standardConfigBean.getElement(bean1.getExtends());
        assertNotNull(bean2);

        assertNotNull(bean2.getDescription());
        assertEquals(bean2.getDescription(), bean1.getDescription());

    }    

Examples of org.apache.shale.clay.config.beans.ComponentBean

        // test the object serialization of the metadata beans
       
        ((ComponentConfigBean) standardConfigBean).setDesigntime(true);      
        loadConfigFiles(null, null);

        ComponentBean live = standardConfigBean.getElement("h:outputText");
        assertNotNull(live);
      
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(os);
        out.writeObject(live);
        out.close();
       
      
        ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
        ObjectInputStream in = new ObjectInputStream(is);
       
        ComponentBean memorex = (ComponentBean) in.readObject();
        in.close();
       
        assertNotNull(memorex);
       
        assertEquals(live.getDescription(), memorex.getDescription());
        assertEquals(live.getJsfid(), memorex.getJsfid());
        assertEquals(live.getAttribute("styleClass").getValue(), memorex.getAttribute("styleClass").getValue());
        assertEquals(live.getSymbol("class").getValue(), memorex.getSymbol("class").getValue());
       
    }

Examples of org.apache.shale.clay.config.beans.ComponentBean

        ServletContextListener chainsListener = new ChainListener();
        ServletContextEvent servletContextEvent = new ServletContextEvent(servletContext);
        chainsListener.contextInitialized(servletContextEvent);
       
        // find the config bean definition in the commons XML config file
        ComponentBean configBean = standardConfigBean.getElement("acme:city");
        assertNotNull("acme:city exists", configBean);
        assertEquals("id", "city", configBean.getId());
       
        AttributeBean size = configBean.getAttribute("size");
        assertNotNull("size", size);
        assertEquals("size", "20", size.getValue());
       
        AttributeBean value = configBean.getAttribute("value");
        assertNotNull("value", value);
        assertEquals("value", "#{@managed-bean-name.city}", value.getValue());
       
        AttributeBean maxlength = configBean.getAttribute("maxlength");
        assertNotNull("maxlength", maxlength);
        assertEquals("maxlength", "30", maxlength.getValue());
       
        AttributeBean required = configBean.getAttribute("required");
        assertNotNull("required", required);
        assertEquals("required", "true", required.getValue());
      

        // load a template that points/extends the acme:city widget
        ComponentBean templateRoot = htmlTemplateConfigBean.getElement("/org/apache/shale/clay/config/altns.html");
        assertNotNull("/org/apache/shale/clay/config/altns.html",  templateRoot);
       
        // config bean after extend by the html template
        ComponentBean cityConfigBean = findForId(configBean.getId(), templateRoot);
        assertNotNull("city from html template", cityConfigBean);
       
        // inherit from acme:city
        assertEquals("id", "city", cityConfigBean.getId());
       
        // html override
        size = cityConfigBean.getAttribute("size");
        assertNotNull("size", size);
        assertEquals("size", "10", size.getValue());
       
        // inherit from acme:city
        value = cityConfigBean.getAttribute("value");
        assertNotNull("value", value);
        assertEquals("value", "#{@managed-bean-name.city}", value.getValue());
       
        // html override
        maxlength = cityConfigBean.getAttribute("maxlength");
        assertNotNull("maxlength", maxlength);
        assertEquals("maxlength", "100", maxlength.getValue());
       
        // html override
        required = cityConfigBean.getAttribute("required");
        assertNotNull("required", required);
        assertEquals("required", "false", required.getValue());
       
        // just because we can
        chainsListener.contextDestroyed(servletContextEvent);

Examples of org.apache.shale.clay.config.beans.ComponentBean

        if (root.getId() != null && root.getId().equals(id)) {
           return root;
        }
        Iterator ci = root.getChildren().iterator();
        while (ci.hasNext()) {
           ComponentBean child = (ComponentBean) ci.next();
           ComponentBean target = findForId(id, child);
           if (target != null) {
              return target;
           }
        }
       

Examples of org.apache.shale.clay.config.beans.ComponentBean

       AttributeBean attr = new AttributeBean();
       attr.setName("value");
       attr.setBindingType(AttributeBean.BINDING_TYPE_NONE);
       attr.setValue("10");
      
       ComponentBean displayElement = new ComponentBean();
       displayElement.setJsfid("inputText");
       displayElement.setComponentType("javax.faces.HtmlOutputText");
       displayElement.setId("testId");
       displayElement.addAttribute(attr);
      
       assertNotNull("attribute case insensitive", displayElement.getAttribute("VaLue"));
      
       ClayContext clayContext = new ClayContext();
       clayContext.setFacesContext(facesContext);
       clayContext.setChild(child);
       clayContext.setAttribute(attr);
TOP
Copyright © 2018 www.massapi.com. 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.