Package org.auraframework.def

Examples of org.auraframework.def.RendererDef


            } else {
                json.writeMapBegin();
                json.writeMapEntry("descriptor", descriptor);
                context.pushCallingDescriptor(descriptor);
                try {
                    RendererDef rendererDef = getRendererDef();
                    if (rendererDef != null && !rendererDef.isLocal()) {
                        json.writeMapEntry("rendererDef", rendererDef);
                    }
                } finally {
                    context.popCallingDescriptor();
                }
View Full Code Here


    public DefDescriptor<RendererDef> getRendererDescriptor() throws QuickFixException {
        if (rendererDescriptors != null && rendererDescriptors.size() == 1) {
            return rendererDescriptors.get(0);
        }

        RendererDef rendererDef = getRendererDef();
        if (rendererDef != null) {
            return rendererDef.getDescriptor();
        }
        return null;
    }
View Full Code Here

        return null;
    }

    @Override
    public RendererDef getLocalRendererDef() throws QuickFixException {
        RendererDef def = null;
        if (rendererDescriptors != null) {
            for (DefDescriptor<RendererDef> desc : rendererDescriptors) {
                def = desc.getDef();
                if (def.isLocal()) {
                    break;
                } else {
                    def = null;
                }
            }
View Full Code Here

    /**
     * @return The primary renderer def. If multiple exist, this will be the remote one.
     * @throws QuickFixException
     */
    public RendererDef getRendererDef() throws QuickFixException {
        RendererDef def = null;
        if (rendererDescriptors != null) {
            for (DefDescriptor<RendererDef> desc : rendererDescriptors) {
                def = desc.getDef();
                if (!def.isLocal()) {
                    break;
                }
            }
        }
        return def;
View Full Code Here

        //
        if (this.getDescriptor().getQualifiedName().equals("markup://aura:placeholder")) {
            return true;
        }

        RendererDef rendererDef = getLocalRendererDef();
        boolean ret = false;
        // have a local renderer?
        if (rendererDef == null) {
            // no?
            rendererDef = getRendererDef();
View Full Code Here

        Aura.getContextService().assertEstablished();

        BaseComponent<?, ?> renderable = null;
        BaseComponent<?, ?> tmpRenderable = component;
        BaseComponentDef componentDef = null;
        RendererDef rendererDef = null;

        while (tmpRenderable != null) {
            componentDef = tmpRenderable.getDescriptor().getDef();
            if (rendererDef == null) {
                rendererDef = componentDef.getLocalRendererDef();
                if (rendererDef == null && componentDef.getRendererDescriptor() != null) {
                    break;
                }
                renderable = tmpRenderable;
            }

            tmpRenderable = tmpRenderable.getSuper();
        }

        if (rendererDef == null) {
            throw new AuraRuntimeException(String.format("No local RendererDef found for %s", component));
        }

        rendererDef.render(renderable, out);
    }
View Full Code Here

            if ((attributeSet.getValueProvider() == null || hasProvidedAttributes) && !attributeSet.isEmpty()) {
                json.writeMapEntry("attributes", attributeSet);
            }

            if (def.getRendererDescriptor() != null) {
                RendererDef rendererDef = def.getRendererDescriptor().getDef();
                if (rendererDef.isLocal()) {
                    StringWriter sw = new StringWriter();
                    rendererDef.render(this, sw);
                    // Not writing directly to json.appendable because then it wouldn't get escaped.
                    // ideally Json would have a FilterWriter that escapes that we could use here.
                    json.writeMapEntry("rendering", sw.toString());
                }
            }
View Full Code Here

     * Verify Generation of JavaRendererDef from JavaRendererDefFactory.
     */
    public void testDefGeneration() throws Exception {
        DefDescriptor<RendererDef> descriptor = DefDescriptorImpl.getInstance(
                "java://org.auraframework.impl.renderer.sampleJavaRenderers.TestSimpleRenderer", RendererDef.class);
        RendererDef def = factory.getDef(descriptor);
        assertTrue("JavaRendererDefFactory should always generate JavaRendererDefs", def instanceof JavaRendererDef);
    }
View Full Code Here

    public void testUseOfJSRendererLocally() throws Exception {
        Component dummyCmp = null;
        StringWriter sw = new StringWriter();
        DefDescriptor<RendererDef> descriptor = DefDescriptorImpl.getInstance("js://test.testJSRenderer",
                RendererDef.class);
        RendererDef def = descriptor.getDef();
        try {
            def.render(dummyCmp, sw);
            fail("Should not able to use a ClientSide renderer to render a component locally.");
        } catch (UnsupportedOperationException expected) {
        }
    }
View Full Code Here

     * @priority medium
     */
    public void testRendererWithComments() throws Exception {
        DefDescriptor<RendererDef> descriptor = DefDescriptorImpl.getInstance("js://test.test_JSRenderer_WithComments",
                RendererDef.class);
        RendererDef def = descriptor.getDef();
        assertNotNull("Failed to fetch the definition of the Javascript Renderer.", def);
        assertTrue(def instanceof JavascriptRendererDef);
        serializeAndGoldFile(def);
    }
View Full Code Here

TOP

Related Classes of org.auraframework.def.RendererDef

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.