Coverage report

  %line %branch
org.apache.commons.jelly.tags.jface.ContributionItemTag
0% 
0% 

 1  
 /*
 2  
  * Copyright 2002,2004 The Apache Software Foundation.
 3  
  *
 4  
  * Licensed under the Apache License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  *      http://www.apache.org/licenses/LICENSE-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.apache.commons.jelly.tags.jface;
 17  
 
 18  
 import org.apache.commons.jelly.JellyTagException;
 19  
 import org.apache.commons.jelly.MissingAttributeException;
 20  
 import org.apache.commons.jelly.XMLOutput;
 21  
 import org.apache.commons.jelly.tags.core.UseBeanTag;
 22  
 import org.eclipse.jface.action.ContributionItem;
 23  
 import org.eclipse.jface.action.IContributionManager;
 24  
 
 25  
 /**
 26  
  * This tag creates an JFace ContributionItem
 27  
  *
 28  
  * @author <a href="mailto:ckl@dacelo.nl">Christiaan ten Klooster</a>
 29  
  */
 30  
 public class ContributionItemTag extends UseBeanTag {
 31  
 
 32  
     public ContributionItemTag(Class arg0) {
 33  0
         super(arg0);
 34  0
     }
 35  
 
 36  
     /**
 37  
       * @see org.apache.commons.jelly.Tag#doTag(org.apache.commons.jelly.XMLOutput)
 38  
       */
 39  
     public void doTag(XMLOutput output)
 40  
         throws MissingAttributeException, JellyTagException {
 41  
 
 42  0
         super.doTag(output);
 43  
 
 44  0
         Object bean = getBean();
 45  0
         if (bean != null && bean instanceof ContributionItem) {
 46  0
             IContributionManager cm = getParentContributionManager();
 47  0
             if (cm != null) {
 48  0
                 cm.add((ContributionItem) bean);
 49  
             }
 50  
         }
 51  
 
 52  0
     }
 53  
 
 54  
     /**
 55  
      * @return IContributionManager
 56  
      */
 57  
     protected IContributionManager getParentContributionManager() {
 58  0
         MenuManagerTag tag =
 59  0
             (MenuManagerTag) findAncestorWithClass(MenuManagerTag.class);
 60  0
         if (tag != null) {
 61  0
             return tag.getMenuManager();
 62  
         }
 63  0
         return null;
 64  
     }
 65  
 
 66  
 }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.