Package org.apache.tapestry5.annotations

Examples of org.apache.tapestry5.annotations.PageActivationContext


    @Test
    public void activate_false_passivate_false()
    {
        ClassTransformation ct = mockClassTransformation();
        MutableComponentModel model = mockMutableComponentModel();
        PageActivationContext annotation = newMock(PageActivationContext.class);
        ComponentClassTransformWorker worker = new PageActivationContextWorker();

        train_findFieldsWithAnnotation(ct, PageActivationContext.class,
                                       "myfield");
        train_getFieldAnnotation(ct, "myfield", PageActivationContext.class,
                                 annotation);
        train_getFieldType(ct, "myfield", CLASS_NAME);
        expect(annotation.activate()).andReturn(false);

        expect(annotation.passivate()).andReturn(false);

        replay();

        worker.transform(ct, model);
View Full Code Here


        if (fields.size() > 1)
            throw new RuntimeException(TransformMessages.illegalNumberOfPageActivationContextHandlers(fields));

        for (String fieldName : fields)
        {
            PageActivationContext annotation = transformation.getFieldAnnotation(fieldName,
                                                                                 PageActivationContext.class);

            String fieldType = transformation.getFieldType(fieldName);

            if (annotation.activate())
            {
                TransformMethodSignature activate
                        = new TransformMethodSignature(Modifier.PROTECTED | Modifier.FINAL, "void",
                                                       "onActivate",
                                                       new String[]{fieldType}, null);
                transformation.addTransformedMethod(activate, fieldName + " = $1;");
            }

            if (annotation.passivate())
            {
                TransformMethodSignature passivate
                        = new TransformMethodSignature(Modifier.PROTECTED | Modifier.FINAL, "java.lang.Object",
                                                       "onPassivate",
                                                       null, null);
View Full Code Here

                {
                    setupRequestFromLink(link);
                    continue;
                }

                Document result = response.getRenderedDocument();

                if (result == null)
                    throw new RuntimeException(String.format("Render of page '%s' did not result in a Document.",
                            pageName));
View Full Code Here

                {
                    setupRequestFromLink(link);
                    continue;
                }

                Document result = response.getRenderedDocument();

                if (result == null)
                    throw new RuntimeException(String.format("Render request '%s' did not result in a Document.",
                            request.getPath()));
View Full Code Here

    {
        List<OptionModel> options = CollectionFactory.newList();

        for (Locale l : supportedLocales)
        {
            options.add(new OptionModelImpl(l.getDisplayName(l), l));
        }

        return new SelectModelImpl(null, options);
    }
View Full Code Here

        for (Locale l : supportedLocales)
        {
            options.add(new OptionModelImpl(l.getDisplayName(l), l));
        }

        return new SelectModelImpl(null, options);
    }
View Full Code Here

    {
        this.parent = parent;
        this.transformer = transformer;
        this.logger = logger;
        this.internalRequestGlobals = internalRequestGlobals;
        this.changeTracker = new URLChangeTracker(classpathURLConverter);

        initializeService();
    }
View Full Code Here

        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        Messages messages = mockMessages();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

    {
        ValidationMessagesSource messagesSource = mockValidationMessagesSource();
        Validator validator = mockValidator();
        TypeCoercer coercer = mockTypeCoercer();
        FieldComponent field = newFieldComponent();
        MessageFormatter formatter = mockMessageFormatter();
        Object inputValue = new Object();
        ComponentResources resources = mockComponentResources();
        Messages containerMessages = mockMessages();
        FormSupport fs = mockFormSupport();
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.annotations.PageActivationContext

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.