Package javax.faces.component.behavior

Examples of javax.faces.component.behavior.Behavior


        // Retrieve the current FaceletContext from FacesContext object
        FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
                FaceletContext.FACELET_CONTEXT_KEY);
       
        ValueExpression ve = null;
        Behavior behavior = null;
        if (_delegate.getBinding() != null)
        {
            ve = _delegate.getBinding().getValueExpression(faceletContext, Behavior.class);
            behavior = (Behavior) ve.getValue(faceletContext);
        }
        if (behavior == null)
        {
            behavior = this.createBehavior(faceletContext);
            if (ve != null)
            {
                ve.setValue(faceletContext, behavior);
            }
        }
        if (behavior == null)
        {
            throw new TagException(_delegate.getTag(), "No Validator was created");
        }
        _delegate.setAttributes(faceletContext, behavior);
       
        if (behavior instanceof ClientBehavior)
        {
            // cast to a ClientBehaviorHolder
            ClientBehaviorHolder cvh = (ClientBehaviorHolder) parent;
           
            // TODO: check if the behavior could be applied to the current parent
            // For run tests it is not necessary, so we let this one pending.

            // It is necessary to obtain a event name for add it, so we have to
            // look first to the defined event name, otherwise take the default from
            // the holder
            String eventName = getEventName();
            if (eventName == null)
            {
                eventName = cvh.getDefaultEventName();
            }
            if (eventName == null)
            {
                throw new TagAttributeException(_delegate.getEvent(), "eventName could not be defined for client behavior "+ behavior.toString());
            }
            else if (!cvh.getEventNames().contains(eventName))
            {
                throw new TagAttributeException(_delegate.getEvent(), "eventName "+eventName+" not found on component instance");
            }
View Full Code Here


            throw new FacesException("Could not find any registered behavior-class for behaviorId : " + behaviorId);
        }
       
        try
        {
            Behavior behavior = (Behavior)behaviorClass.newInstance();

            _handleAttachedResourceDependencyAnnotations(FacesContext.getCurrentInstance(), behavior);

            if (behavior instanceof ClientBehaviorBase)
            {
View Full Code Here

            throw new FacesException("Could not find any registered behavior-class for behaviorId : " + behaviorId);
        }
       
        try
        {
            Behavior behavior = (Behavior)behaviorClass.newInstance();

            _handleAttachedResourceDependencyAnnotations(FacesContext.getCurrentInstance(), behavior);

            if (behavior instanceof ClientBehaviorBase)
            {
View Full Code Here

        }
        try
        {
            if (event instanceof BehaviorEvent && event.getComponent() == this)
            {
                Behavior behavior = ((BehaviorEvent) event).getBehavior();
                behavior.broadcast((BehaviorEvent) event);
            }
           
            if (_facesListeners == null)
            {
                return;
View Full Code Here

            throw new NullPointerException("event");
        }
       
        if (event instanceof BehaviorEvent && event.getComponent() == this)
        {
            Behavior behavior = ((BehaviorEvent) event).getBehavior();
            behavior.broadcast((BehaviorEvent) event);
        }

        if (_facesListeners == null)
        {
            return;
View Full Code Here

            throw new FacesException("Could not find any registered behavior-class for behaviorId : " + behaviorId);
        }
       
        try
        {
            Behavior behavior = (Behavior)behaviorClass.newInstance();
            FacesContext facesContext = FacesContext.getCurrentInstance();
            _handleAttachedResourceDependencyAnnotations(facesContext, behavior);

            if (behavior instanceof ClientBehaviorBase)
            {
View Full Code Here

            throw new FacesException("Could not find any registered behavior-class for behaviorId : " + behaviorId);
        }
       
        try
        {
            Behavior behavior = (Behavior)behaviorClass.newInstance();

            _handleAttachedResourceDependencyAnnotations(FacesContext.getCurrentInstance(), behavior);

            if (behavior instanceof ClientBehaviorBase)
            {
View Full Code Here

        }
        try
        {
            if (event instanceof BehaviorEvent && event.getComponent() == this)
            {
                Behavior behavior = ((BehaviorEvent) event).getBehavior();
                behavior.broadcast((BehaviorEvent) event);
            }
           
            if (_facesListeners == null)
            {
                return;
View Full Code Here

        // Retrieve the current FaceletContext from FacesContext object
        FaceletContext faceletContext = (FaceletContext) context.getAttributes().get(
                FaceletContext.FACELET_CONTEXT_KEY);
       
        ValueExpression ve = null;
        Behavior behavior = null;
        if (_delegate.getBinding() != null)
        {
            ve = _delegate.getBinding().getValueExpression(faceletContext, Behavior.class);
            behavior = (Behavior) ve.getValue(faceletContext);
        }
        if (behavior == null)
        {
            behavior = this.createBehavior(faceletContext);
            if (ve != null)
            {
                ve.setValue(faceletContext, behavior);
            }
        }
        if (behavior == null)
        {
            throw new TagException(_delegate.getTag(), "No Validator was created");
        }
        _delegate.setAttributes(faceletContext, behavior);
       
        if (behavior instanceof ClientBehavior)
        {
            // cast to a ClientBehaviorHolder
            ClientBehaviorHolder cvh = (ClientBehaviorHolder) parent;
           
            // TODO: check if the behavior could be applied to the current parent
            // For run tests it is not necessary, so we let this one pending.

            // It is necessary to obtain a event name for add it, so we have to
            // look first to the defined event name, otherwise take the default from
            // the holder
            String eventName = getEventName();
            if (eventName == null)
            {
                eventName = cvh.getDefaultEventName();
            }
            if (eventName == null)
            {
                throw new TagAttributeException(_delegate.getEvent(),
                        "eventName could not be defined for client behavior "+ behavior.toString());
            }
            else if (!cvh.getEventNames().contains(eventName))
            {
                throw new TagAttributeException(_delegate.getEvent(),
                        "eventName "+eventName+" not found on component instance");
View Full Code Here

            throw new FacesException("Could not find any registered behavior-class for behaviorId : " + behaviorId);
        }
       
        try
        {
            Behavior behavior = (Behavior)behaviorClass.newInstance();

            _handleAttachedResourceDependencyAnnotations(FacesContext.getCurrentInstance(), behavior);

            if (behavior instanceof ClientBehaviorBase)
            {
View Full Code Here

TOP

Related Classes of javax.faces.component.behavior.Behavior

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.