Package javax.faces.component

Examples of javax.faces.component.StateHolder


            if (restoredObject instanceof StateHolder)
            {
                _AttachedStateWrapper wrapper = (_AttachedStateWrapper) stateObj;
                Object wrappedState = wrapper.getWrappedStateObject();

                StateHolder holder = (StateHolder) restoredObject;
                holder.restoreState(context, wrappedState);
            }
            return restoredObject;
        }
        else
        {
View Full Code Here


            Object tabChangeListenerSaved = null;
            if (!_isSetTabChangeListener() &&
                _tabChangeListener != null && _tabChangeListener instanceof PartialStateHolder)
            {
                //Delta
                StateHolder holder = (StateHolder) _tabChangeListener;
                if (!holder.isTransient())
                {
                    Object attachedState = holder.saveState(facesContext);
                    if (attachedState != null)
                    {
                        nullDelta = false;
                    }
                    tabChangeListenerSaved = new AttachedDeltaWrapper(_tabChangeListener.getClass(),
View Full Code Here

            Object actionListenerSaved = null;
            if (!_isSetActionListener() &&
                _actionListener != null && _actionListener instanceof PartialStateHolder)
            {
                //Delta
                StateHolder holder = (StateHolder) _actionListener;
                if (!holder.isTransient())
                {
                    Object attachedState = holder.saveState(facesContext);
                    if (attachedState != null)
                    {
                        nullDelta = false;
                    }
                    actionListenerSaved = new AttachedDeltaWrapper(_actionListener.getClass(),
View Full Code Here

            Object actionListenerSaved = null;
            if (!_isSetActionListener() &&
                _actionListener != null && _actionListener instanceof PartialStateHolder)
            {
                //Delta
                StateHolder holder = (StateHolder) _actionListener;
                if (!holder.isTransient())
                {
                    Object attachedState = holder.saveState(facesContext);
                    if (attachedState != null)
                    {
                        nullDelta = false;
                    }
                    actionListenerSaved = new AttachedDeltaWrapper(_actionListener.getClass(),
                        attachedState);
                }
            }
            else  if (_isSetActionListener() || _actionListener != null)
            {
                //Full
                actionListenerSaved = saveAttachedState(facesContext,_actionListener);
                nullDelta = false;
            }       
            Object actionExpressionSaved = null;
            if (!_isSetActionExpression() &&
                _actionExpression != null && _actionExpression instanceof PartialStateHolder)
            {
                //Delta
                StateHolder holder = (StateHolder) _actionExpression;
                if (!holder.isTransient())
                {
                    Object attachedState = holder.saveState(facesContext);
                    if (attachedState != null)
                    {
                        nullDelta = false;
                    }
                    actionExpressionSaved = new AttachedDeltaWrapper(_actionExpression.getClass(),
                        attachedState);
                }
            }
            else  if (_isSetActionExpression() || _actionExpression != null)
            {
                //Full
                actionExpressionSaved = saveAttachedState(facesContext,_actionExpression);
                nullDelta = false;
            }       
            Object mouseListenerExpressionSaved = null;
            if (!_isSetActionListener() &&
                _mouseListenerExpression != null && _mouseListenerExpression instanceof PartialStateHolder)
            {
                //Delta
                StateHolder holder = (StateHolder) _mouseListenerExpression;
                if (!holder.isTransient())
                {
                    Object attachedState = holder.saveState(facesContext);
                    if (attachedState != null)
                    {
                        nullDelta = false;
                    }
                    mouseListenerExpressionSaved = new AttachedDeltaWrapper(_mouseListenerExpression.getClass(),
View Full Code Here

            return null;
        // StateHolder interface should take precedence over
        // List children
        if (attachedObject instanceof StateHolder)
        {
            StateHolder holder = (StateHolder) attachedObject;
            if (holder.isTransient())
            {
                return null;
            }

            return new _AttachedStateWrapper(attachedObject.getClass(), holder.saveState(context));
        }       
        else if (attachedObject instanceof List)
        {
            List<Object> lst = new ArrayList<Object>(((List<?>) attachedObject).size());
            for (Object item : (List<?>) attachedObject)
View Full Code Here

            if (restoredObject instanceof StateHolder)
            {
                _AttachedStateWrapper wrapper = (_AttachedStateWrapper) stateObj;
                Object wrappedState = wrapper.getWrappedStateObject();

                StateHolder holder = (StateHolder) restoredObject;
                holder.restoreState(context, wrappedState);
            }
            return restoredObject;
        }
        else
        {
View Full Code Here

            return null;
        // StateHolder interface should take precedence over
        // List children
        if (attachedObject instanceof StateHolder)
        {
            StateHolder holder = (StateHolder) attachedObject;
            if (holder.isTransient())
            {
                return null;
            }

            return new _AttachedStateWrapper(attachedObject.getClass(), holder.saveState(context));
        }       
        else if (attachedObject instanceof List)
        {
            List<Object> lst = new ArrayList<Object>(((List<?>) attachedObject).size());
            for (Object item : (List<?>) attachedObject)
View Full Code Here

            if (restoredObject instanceof StateHolder)
            {
                _AttachedStateWrapper wrapper = (_AttachedStateWrapper) stateObj;
                Object wrappedState = wrapper.getWrappedStateObject();

                StateHolder holder = (StateHolder) restoredObject;
                holder.restoreState(context, wrappedState);
            }
            return restoredObject;
        }
        else
        {
View Full Code Here

  public Object saveState(FacesContext context) {
    boolean hasState = false;
    Object[] stateArray = new Object[this.stateHolders.size()];
    for (int i = 0; i < stateArray.length; i++) {
      StateHolder stateHolder = this.stateHolders.get(i);
      if (this.initialState) {
        if (!stateHolder.isTransient()) {
          stateArray[i] = stateHolder.saveState(context);
          hasState = true;
        }
      } else {
        stateArray[i] = new SavedAttachedState(UIComponentBase.saveAttachedState(context, stateHolder));
        hasState = true;
View Full Code Here

    if (state != null) {
      Object[] stateArray = (Object[]) state;
      boolean savedFromInitialState = !(stateArray.length > 0 && stateArray[0] instanceof SavedAttachedState);
      if (savedFromInitialState) {
        for (int i = 0; i < stateArray.length; i++) {
          StateHolder stateHolder = this.stateHolders.get(i);
          stateHolder.restoreState(context, stateArray[i]);
        }
      } else {
        this.stateHolders.clear();
        for (int i = 0; i < stateArray.length; i++) {
          SavedAttachedState savedAttachedState = (SavedAttachedState) stateArray[i];
View Full Code Here

TOP

Related Classes of javax.faces.component.StateHolder

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.