Coverage Report - javax.faces.component.UIOutcomeTarget
 
Classes in this File Line Coverage Branch Coverage Complexity
UIOutcomeTarget
0%
0/13
0%
0/4
0
UIOutcomeTarget$PropertyKeys
0%
0/3
N/A
0
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *   http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing,
 13  
  * software distributed under the License is distributed on an
 14  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  * KIND, either express or implied.  See the License for the
 16  
  * specific language governing permissions and limitations
 17  
  * under the License.
 18  
  */
 19  
 package javax.faces.component;
 20  
 
 21  
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
 22  
 import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
 23  
 
 24  
 /**
 25  
  * 
 26  
  * @since 2.0
 27  
  */
 28  
 @JSFComponent
 29  
 public class UIOutcomeTarget extends UIOutput
 30  
 {
 31  
     public static final String COMPONENT_TYPE = "javax.faces.OutcomeTarget";
 32  
     public static final String COMPONENT_FAMILY = "javax.faces.OutcomeTarget";
 33  
     
 34  
     private static final boolean DEFAULT_INCLUDEVIEWPARAMS = false;
 35  
     
 36  
     public UIOutcomeTarget()
 37  
     {
 38  0
         super();
 39  0
         setRendererType("javax.faces.Link");
 40  0
     }
 41  
     
 42  
     public String getFamily()
 43  
     {
 44  0
         return COMPONENT_FAMILY;
 45  
     }
 46  
 
 47  
     @JSFProperty
 48  
     public String getOutcome()
 49  
     {
 50  0
         String outcome = (String) getStateHelper().eval(PropertyKeys.outcome);
 51  
         
 52  0
         if(outcome == null && isInView())  //default to the view id
 53  
         {
 54  0
             return getFacesContext().getViewRoot().getViewId();
 55  
         }
 56  
         
 57  0
         return outcome;
 58  
     }
 59  
 
 60  
     public void setOutcome(String outcome)
 61  
     {
 62  0
         getStateHelper().put(PropertyKeys.outcome, outcome);
 63  0
     }
 64  
 
 65  
     @JSFProperty(defaultValue="false")
 66  
     public boolean isIncludeViewParams()
 67  
     {        
 68  0
         return (Boolean) getStateHelper().eval(PropertyKeys.includeViewParams, DEFAULT_INCLUDEVIEWPARAMS);
 69  
     }
 70  
 
 71  
     public void setIncludeViewParams(boolean includeViewParams)
 72  
     {
 73  0
         getStateHelper().put(PropertyKeys.includeViewParams, includeViewParams);
 74  0
     }
 75  
     
 76  0
     enum PropertyKeys {
 77  0
         includeViewParams,
 78  0
         outcome
 79  
     }
 80  
 }