Clover coverage report -
Coverage timestamp: Sun Apr 18 2004 21:32:30 EDT
file stats: LOC: 83   Methods: 4
NCLOC: 38   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ManagePluginsAction.java 0% 17.6% 75% 24%
coverage coverage
 1   
 /*
 2   
  * SimplyHTML, a word processor based on Java, HTML and CSS
 3   
  * Copyright (C) 2002 Ulrich Hilger
 4   
  *
 5   
  * This program is free software; you can redistribute it and/or
 6   
  * modify it under the terms of the GNU General Public License
 7   
  * as published by the Free Software Foundation; either version 2
 8   
  * of the License, or (at your option) any later version.
 9   
  *
 10   
  * This program is distributed in the hope that it will be useful,
 11   
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12   
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13   
  * GNU General Public License for more details.
 14   
  *
 15   
  * You should have received a copy of the GNU General Public License
 16   
  * along with this program; if not, write to the Free Software
 17   
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 18   
  */
 19   
 
 20   
 import javax.swing.AbstractAction;
 21   
 import java.awt.event.*;
 22   
 //import com.lightdev.app.shtm.SHTMLAction;
 23   
 //import com.lightdev.app.shtm.FrmMain;
 24   
 //import com.lightdev.app.shtm.Util;
 25   
 import javax.swing.Action;
 26   
 //import com.lightdev.app.shtm.DialogShell;
 27   
 import java.util.Enumeration;
 28   
 
 29   
 /**
 30   
  * Action to invoke a PluginManagerDialog
 31   
  *
 32   
  * @author Ulrich Hilger
 33   
  * @author Light Development
 34   
  * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
 35   
  * @author <a href="mailto:info@lightdev.com">info@lightdev.com</a>
 36   
  * @author published under the terms and conditions of the
 37   
  *      GNU General Public License,
 38   
  *      for details see file gpl.txt in the distribution
 39   
  *      package of this software
 40   
  *
 41   
  * @version stage 11, April 27, 2003
 42   
  */
 43   
 
 44   
 public class ManagePluginsAction extends AbstractAction
 45   
     implements SHTMLAction
 46   
 {
 47   
   public static final String managePluginsAction = "managePlugins";
 48   
 
 49  75
   public ManagePluginsAction() {
 50  75
     super(managePluginsAction);
 51  75
     getProperties();
 52   
     /*putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke(
 53   
         KeyEvent.VK_N, KeyEvent.CTRL_MASK));*/
 54   
   }
 55  0
   public void actionPerformed(ActionEvent e) {
 56  0
     PluginManagerDialog pmd = new PluginManagerDialog(FrmMain.mainFrame,
 57   
         FrmMain.dynRes.getResourceString(FrmMain.resources,
 58   
         "pluginManagerDialogTitle"));
 59  0
     Util.center(FrmMain.mainFrame, pmd);
 60  0
     pmd.setModal(true);
 61  0
     pmd.show();
 62   
 
 63   
     /** if the user made a selection, apply it to the document */
 64  0
     if(pmd.getResult() == DialogShell.RESULT_OK) {
 65  0
       ((FrmMain) FrmMain.mainFrame).clearDockPanels();
 66  0
       Enumeration plugins = FrmMain.pluginManager.plugins();
 67  0
       SHTMLPlugin pi;
 68  0
       while(plugins.hasMoreElements()) {
 69  0
         pi = (SHTMLPlugin) plugins.nextElement();
 70  0
         ((FrmMain) FrmMain.mainFrame).refreshPluginDisplay(pi);
 71   
       }
 72  0
       ((FrmMain) FrmMain.mainFrame).paintComponents(
 73   
           ((FrmMain) FrmMain.mainFrame).getGraphics());
 74   
     }
 75  0
     ((FrmMain) FrmMain.mainFrame).adjustDividers();
 76  0
     ((FrmMain) FrmMain.mainFrame).updateActions();
 77   
   }
 78  231
   public void update() {
 79   
   }
 80  75
   public void getProperties() {
 81  75
     FrmMain.getActionProperties(this, (String) getValue(Action.NAME));
 82   
   }
 83   
 }