Examples of IBinding


Examples of org.apache.tapestry.IBinding

     * Returns the makeNodeDirect.
     * @return Boolean
     */
    public boolean getMakeNodeDirect() {
        if(m_objMakeNodeDirect == null){
            IBinding objBinding = getMakeNodeDirectBinding();
            if(objBinding != null){
                m_objMakeNodeDirect = (Boolean)objBinding.getObject();
            }else{
                m_objMakeNodeDirect = Boolean.TRUE;
            }
        }
        return m_objMakeNodeDirect.booleanValue();
View Full Code Here

Examples of org.apache.tapestry.IBinding

            // selected.

            if (value == null)
                return;

            IBinding selectedBinding = getSelectedBinding();

            if (selectedBinding != null)
                selectedBinding.setObject(getTag());

            IActionListener listener = getListener();

            if (listener != null)
                listener.actionTriggered(this, cycle);
View Full Code Here

Examples of org.apache.tapestry.IBinding

    _featuresBinding = featuresBinding;
  }

  public String getHref()
  {
    IBinding aHrefBinding = getHrefBinding();

    if (aHrefBinding != null)
    {
            String encoding = getPage().getEngine().getOutputEncoding();
            try
            {
                return _urlCodec.encode(aHrefBinding.getString(), encoding);
            }
            catch (UnsupportedEncodingException e)
            {
                throw new ApplicationRuntimeException(
                    Tapestry.format("illegal-encoding", encoding),
View Full Code Here

Examples of org.apache.tapestry.IBinding

    return null;
  }

  public String getWindowName()
  {
    IBinding aWindowNameBinding = getWindowNameBinding();
    if (aWindowNameBinding != null)
    {
      return aWindowNameBinding.getString();
    }
    else
    {
      return DEFAULT_WINDOW_NAME;
    }
View Full Code Here

Examples of org.apache.tapestry.IBinding

    }
  }

  public String getFeatures()
  {
    IBinding aFeaturesBinding = getFeaturesBinding();
    if (aFeaturesBinding != null)
    {
      return aFeaturesBinding.getString();
    }
    else
    {
      return "";
    }
View Full Code Here

Examples of org.apache.tapestry.IBinding

                // If the value isn't the elementId of this component, then this link wasn't
                // selected.

                if (value != null && value.equals(name))
                {
                    IBinding selectedBinding = getSelectedBinding();
                    if (selectedBinding != null)
                        selectedBinding.setObject(getTag());
                    IActionListener listener = getListener();
                    if (listener != null)
                        listener.actionTriggered(this, cycle);
                }
            }
View Full Code Here

Examples of org.apache.tapestry.IBinding

            String name = (String) i.next();

            if (debug)
                LOG.debug("Connecting parameter " + name + ".");

            IBinding binding = _component.getBinding(name);
            if (binding == null)
            {
                if (debug)
                    LOG.debug("Not bound.");

                continue;
            }

            IParameterSpecification pspec = spec.getParameter(name);
            Direction direction = pspec.getDirection();

            if (direction != Direction.IN && direction != Direction.FORM)
            {
                if (debug)
                    LOG.debug("Parameter is " + pspec.getDirection().getName() + ".");

                continue;
            }

            if (!direction.getAllowInvariant() && binding.isInvariant())
                throw new ConnectedParameterException(
                    Tapestry.format(
                        "ParameterManager.incompatible-direction-and-binding",
                        new Object[] {
                            name,
                            _component.getExtendedId(),
                            direction.getDisplayName(),
                            binding }),
                    _component,
                    name,
                    null,
                    binding.getLocation(),
                    null);

            String propertyName = pspec.getPropertyName();

            if (debug && !name.equals(propertyName))
                LOG.debug("Connecting to property " + propertyName + ".");

            // Next,verify that there is a writable property with the same
            // name as the parameter.

            PropertyInfo propertyInfo =
                PropertyFinder.getPropertyInfo(_component.getClass(), propertyName);

            if (propertyInfo == null)
            {
                throw new ConnectedParameterException(
                    Tapestry.format(
                        "ParameterManager.no-accessor",
                        _component.getExtendedId(),
                        propertyName),
                    _component,
                    name,
                    propertyName,
                    binding.getLocation(),
                    null);
            }

            if (!propertyInfo.isReadWrite())
            {
                throw new ConnectedParameterException(
                    Tapestry.format(
                        "ParameterManager.property-not-read-write",
                        _component.getExtendedId(),
                        propertyName),
                    _component,
                    name,
                    propertyName,
                    binding.getLocation(),
                    null);
            }

            // Check if the parameter type matches the property type

            Class propertyType = propertyInfo.getType();
            Class parameterType = getType(pspec.getType(), resolver);

            if (parameterType == null)
            {
                throw new ConnectedParameterException(
                    Tapestry.format(
                        "ParameterManager.java-type-not-specified",
                        name,
                        _component.getExtendedId()),
                    _component,
                    name,
                    propertyName,
                    binding.getLocation(),
                    null);
            }

            if (!propertyType.equals(parameterType))
            {
                throw new ConnectedParameterException(
                    Tapestry.format(
                        "ParameterManager.type-mismatch",
                        new String[] {
                            name,
                            _component.getExtendedId(),
                            parameterType.toString(),
                            propertyType.toString()}),
                    _component,
                    name,
                    propertyName,
                    binding.getLocation(),
                    null);
            }

            // Here's where we will sniff it for type, for the moment
            // assume its some form of object (not scalar) type.

            IParameterConnector connector =
                createConnector(_component, name, binding, propertyType, parameterType);

            // Static bindings are set here and then forgotten
            // about.  Dynamic bindings are kept for later.

            if (binding.isInvariant())
            {
                if (debug)
                    LOG.debug("Setting invariant value using " + connector + ".");

                try
                {
                    connector.setParameter(cycle);
                }
                catch (BindingException ex)
                {
                    throw new ConnectedParameterException(
                        Tapestry.format(
                            "ParameterManager.static-initialization-failure",
                            propertyName,
                            _component.getExtendedId(),
                            binding.toString()),
                        _component,
                        name,
                        propertyName,
                        ex);
                }
View Full Code Here

Examples of org.apache.tapestry.IBinding

     *
     **/

    public boolean getRequiresSession()
    {
      IBinding statefulBinding = getStatefulBinding();
     
        if (statefulBinding == null)
            return true;

        return statefulBinding.getBoolean();
    }
View Full Code Here

Examples of org.apache.tapestry.IBinding

            // Skip formal parameters

            if (getSpecification().getParameter(bindingName) != null)
                continue;

            IBinding binding = getBinding(bindingName);

            Object value = binding.getObject();

            result.put(bindingName, value);
        }

        return result;
View Full Code Here

Examples of org.apache.tapestry.IBinding

     *
     **/

    public boolean isStateful()
    {
        IBinding statefulBinding = getStatefulBinding();

        if (statefulBinding == null)
            return true;

        return statefulBinding.getBoolean();
    }
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.