Coverage Report - org.xmlhammer.gui.actions.HelpTOCAction
 
Classes in this File Line Coverage Branch Coverage Complexity
HelpTOCAction
78% 
N/A 
1
 
 1  
 /*
 2  
  * $Id$
 3  
  *
 4  
  * The contents of this file are subject to the Mozilla Public License 
 5  
  * Version 1.1 (the "License"); you may not use this file except in 
 6  
  * compliance with the License. You may obtain a copy of the License at 
 7  
  * http://www.mozilla.org/MPL/ 
 8  
  *
 9  
  * Software distributed under the License is distributed on an "AS IS" basis, 
 10  
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License 
 11  
  * for the specific language governing rights and limitations under the License.
 12  
  *
 13  
  * The Original Code is XML Hammer code. (org.xmlhammer.*)
 14  
  *
 15  
  * The Initial Developer of the Original Code is Edwin Dankert. Portions created 
 16  
  * by the Initial Developer are Copyright (C) 2005 - 2006 the Initial Developer. 
 17  
  * All Rights Reserved.
 18  
  *
 19  
  * Contributor(s): Edwin Dankert <edankert@gmail.com>
 20  
  */
 21  
 package org.xmlhammer.gui.actions;
 22  
 
 23  
 import javax.swing.ImageIcon;
 24  
 
 25  
 import org.bounce.RunnableAction;
 26  
 import org.xmlhammer.gui.XMLHammer;
 27  
 
 28  
 /**
 29  
  * An action that can be used to show Properties for a specific page.
 30  
  *
 31  
  * @version        $Revision$, $Date$
 32  
  * @author Edwin Dankert <edankert@gmail.com>
 33  
  */
 34  
  public class HelpTOCAction extends RunnableAction {
 35  
          private static final long serialVersionUID = 3258134648029526321L;
 36  
 
 37  220
          private XMLHammer parent = null;
 38  
         
 39  
          /**
 40  
          * The constructor for the action which shows Properties for a specific page.
 41  
      * 
 42  
      * @param page the page the properties should be shown for.
 43  
          */
 44  
          public HelpTOCAction(XMLHammer parent) {
 45  220
                  super("Table of Contents");
 46  
 
 47  220
         putValue(MNEMONIC_KEY, new Integer('T'));
 48  220
                 putValue(SHORT_DESCRIPTION, "Help Table of Contents");
 49  220
                 putValue(SMALL_ICON, new ImageIcon(getClass().getResource("/org/xmlhammer/gui/icons/etool16/alltopics_co.gif")));
 50  
                 
 51  220
         this.parent = parent;
 52  220
          }
 53  
          
 54  
         /**
 55  
          * The implementation of the Page Properties action, called 
 56  
          * after a user action.
 57  
          */
 58  
          public void run() {
 59  0
         parent.showHelpTOC();
 60  0
          }
 61  
 }