Examples of LiteralBinding


Examples of org.apache.tapestry.binding.LiteralBinding

    {

        public IBinding createBinding(IComponent component, String description, String reference,
                String defaultBindingType, Location location)
        {
            return new LiteralBinding(description, _valueConverter, location, reference);
        }
View Full Code Here

Examples of org.apache.tapestry.binding.LiteralBinding

    {

        public IBinding createBinding(IComponent component, String description, String reference,
                Location location)
        {
            return new LiteralBinding(description, _valueConverter, location, reference);
        }
View Full Code Here

Examples of org.apache.tapestry.binding.LiteralBinding

    {

        public IBinding createBinding(IComponent component, String description, String reference,
                String defaultBindingType, Location location)
        {
            return new LiteralBinding(description, _valueConverter, location, reference);
        }
View Full Code Here

Examples of org.apache.tapestry.binding.LiteralBinding

    {

        public IBinding createBinding(IComponent component, String description, String reference,
                String defaultBindingType, Location location)
        {
            return new LiteralBinding(description, _valueConverter, location, reference);
        }
View Full Code Here

Examples of org.apache.tapestry.binding.LiteralBinding

    {

        public IBinding createBinding(IComponent component, String description, String reference,
                String defaultBindingType, Location location)
        {
            return new LiteralBinding(description, _valueConverter, location, reference);
        }
View Full Code Here

Examples of org.apache.tapestry.binding.LiteralBinding

    {

        public IBinding createBinding(IComponent component, String description, String reference,
                String defaultBindingType, Location location)
        {
            return new LiteralBinding(description, _valueConverter, location, reference);
        }
View Full Code Here

Examples of org.apache.tapestry.binding.LiteralBinding

        }

        public IBinding createBinding(IComponent component, IParameterSpecification param, String description, String reference,
                String defaultBindingType, Location location)
        {
            return new LiteralBinding(description, _valueConverter, location, reference);
        }
View Full Code Here

Examples of org.apache.tapestry.binding.LiteralBinding

                            htmlClass =(String)htmlClassBinding.getObject(String.class) + " "+htmlClassToAdd;
                        } else {
                            getLog().debug(activity.getFullActivityInstanceNamespace()+ ": cannot add class to component="+formComponent);
                        }
                        if (htmlClass != null) {
                            formComponent.setBinding(HTML_CLASS, new LiteralBinding("html class", valueConverter, location, htmlClass));
                        }
                        if (htmlOnBlurBinding == null) {
                            String htmlOnBlurValue = "javascript:amplafi.util.refreshIfChanged(this);";
                            formComponent.setBinding(HTML_ONBLUR, new LiteralBinding("html on blur", valueConverter, location, htmlOnBlurValue));

                        } else {
                            getLog().debug(activity.getFullActivityInstanceNamespace()+ ": cannot add onblur to component="+formComponent);
                        }
                    }
                    if (validatorsBinding == null) {
                        String validators = definition.getValidators();
                        if ( definition.getPropertyRequired() == FlowActivityPhase.advance) {
                            if ( isBlank(validators)) {
                                validators = REQUIRED;
                            } else {
                                // may re-add required if already present - seems like a minor issue
                                validators = REQUIRED + "," + validators;
                            }
                        }
                        if (isNotBlank(validators)) {
                            validatorsBinding = this.validationBindingFactory.createBinding(formComponent, "", validators, null);
                            formComponent.setBinding(VALIDATORS, validatorsBinding);
                        }
                    } else if ( getLog().isDebugEnabled()){
                        getLog().debug(activity.getFullActivityInstanceNamespace()+": property binding "+this+": make sure that @Parameter(cache=false) is set because first access is not by a ValidatableField component");
                    }
                }
                // avoid constantly re-adding the bindings
                // HACK: this however results in adding the attribute to all html nodes using a FlowPropertyBinding.
                formComponent.setBinding(ALREADY_ADDED_BINDING, new LiteralBinding(ALREADY_ADDED_BINDING, valueConverter, location, "true"));
            }
        }
    }
View Full Code Here

Examples of org.apache.tapestry.internal.bindings.LiteralBinding

                    ComponentResources component, String expression, Location location)
            {
                String key = expression.trim();

                if (_keywords.containsKey(key))
                    return new LiteralBinding(description, _keywords.get(key), location);

                return null;
            }
        };

        BindingFactory thisFactory = new BindingFactory()
        {

            public Binding newBinding(String description, ComponentResources container,
                    ComponentResources component, String expression, Location location)
            {
                if ("this".equalsIgnoreCase(expression.trim()))
                    return new LiteralBinding(description, container.getComponent(), location);

                return null;
            }
        };

        BindingFactory longFactory = new BindingFactory()
        {
            private final Pattern _pattern = Pattern.compile("^\\s*(-?\\d+)\\s*$");

            public Binding newBinding(String description, ComponentResources container,
                    ComponentResources component, String expression, Location location)
            {
                Matcher matcher = _pattern.matcher(expression);

                if (matcher.matches())
                {
                    String value = matcher.group(1);

                    return new LiteralBinding(description, new Long(value), location);
                }

                return null;
            }
        };

        BindingFactory intRangeFactory = new BindingFactory()
        {
            private final Pattern _pattern = Pattern
                    .compile("^\\s*(-?\\d+)\\s*\\.\\.\\s*(-?\\d+)\\s*$");

            public Binding newBinding(String description, ComponentResources container,
                    ComponentResources component, String expression, Location location)
            {
                Matcher matcher = _pattern.matcher(expression);

                if (matcher.matches())
                {
                    int start = Integer.parseInt(matcher.group(1));
                    int finish = Integer.parseInt(matcher.group(2));

                    IntegerRange range = new IntegerRange(start, finish);

                    return new LiteralBinding(description, range, location);
                }

                return null;
            }
        };

        BindingFactory doubleFactory = new BindingFactory()
        {
            // So, either 1234. or 1234.56 or .78
            private final Pattern _pattern = Pattern
                    .compile("^\\s*(\\-?((\\d+\\.)|(\\d*\\.\\d+)))\\s*$");

            public Binding newBinding(String description, ComponentResources container,
                    ComponentResources component, String expression, Location location)
            {
                Matcher matcher = _pattern.matcher(expression);

                if (matcher.matches())
                {
                    String value = matcher.group(1);

                    return new LiteralBinding(description, new Double(value), location);
                }

                return null;
            }
        };

        BindingFactory stringFactory = new BindingFactory()
        {
            // This will match embedded single quotes as-is, no escaping necessary.

            private final Pattern _pattern = Pattern.compile("^\\s*'(.*)'\\s*$");

            public Binding newBinding(String description, ComponentResources container,
                    ComponentResources component, String expression, Location location)
            {
                Matcher matcher = _pattern.matcher(expression);

                if (matcher.matches())
                {
                    String value = matcher.group(1);

                    return new LiteralBinding(description, value, location);
                }

                return null;
            }
        };
View Full Code Here

Examples of org.apache.tapestry.internal.bindings.LiteralBinding

    private void parameter(ParameterToken token)
    {
        BlockImpl block = new BlockImpl(token.getLocation());
        String name = token.getName();

        Binding binding = new LiteralBinding("block parameter " + name, block, token.getLocation());

        // TODO: Check that the t:parameter doesn't appear outside of an embedded component.

        _activeElementStack.peek().bindParameter(name, binding);
View Full Code Here
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.