Coverage Report - org.homeunix.thecave.buddi.view.menu.items.ViewRollAllBudgetCategories
 
Classes in this File Line Coverage Branch Coverage Complexity
ViewRollAllBudgetCategories
25%
2/8
0%
0/4
2.5
 
 1  
 /*
 2  
  * Created on Aug 6, 2007 by wyatt
 3  
  */
 4  
 package org.homeunix.thecave.buddi.view.menu.items;
 5  
 
 6  
 import java.awt.event.ActionEvent;
 7  
 
 8  
 import org.homeunix.thecave.buddi.i18n.keys.MenuKeys;
 9  
 import org.homeunix.thecave.buddi.model.BudgetCategory;
 10  
 import org.homeunix.thecave.buddi.model.Document;
 11  
 import org.homeunix.thecave.buddi.model.prefs.PrefsModel;
 12  
 import org.homeunix.thecave.buddi.view.MainFrame;
 13  
 
 14  
 import ca.digitalcave.moss.swing.MossMenuItem;
 15  
 
 16  
 public class ViewRollAllBudgetCategories extends MossMenuItem{
 17  
         public static final long serialVersionUID = 0;
 18  
         
 19  
         public ViewRollAllBudgetCategories(MainFrame frame) {
 20  256
                 super(frame, PrefsModel.getInstance().getTranslator().get(MenuKeys.MENU_EDIT_ROLL_ALL_BUDGET_CATEGORIES));
 21  256
         }
 22  
         
 23  
         @Override
 24  
         public void actionPerformed(ActionEvent e) {
 25  0
                 if (!(getFrame() instanceof MainFrame))
 26  0
                         throw new RuntimeException("Calling frame not instance of MainFrame");
 27  
                         
 28  0
                 for (BudgetCategory bc : ((Document) ((MainFrame) getFrame()).getDocument()).getBudgetCategories()) {
 29  0
                         bc.setExpanded(false);
 30  
                 }
 31  
                 
 32  0
                 ((MainFrame) getFrame()).updateContent();
 33  0
         }
 34  
 }