| 1 | |
|
| 2 | |
|
| 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.AccountType; |
| 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 ViewRollAllAccounts extends MossMenuItem{ |
| 17 | |
public static final long serialVersionUID = 0; |
| 18 | |
|
| 19 | |
public ViewRollAllAccounts(MainFrame frame) { |
| 20 | 29974 | super(frame, PrefsModel.getInstance().getTranslator().get(MenuKeys.MENU_EDIT_ROLL_ALL_ACCOUNTS)); |
| 21 | 29974 | } |
| 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 (AccountType at : ((Document) ((MainFrame) getFrame()).getDocument()).getAccountTypes()) { |
| 29 | 0 | at.setExpanded(false); |
| 30 | |
} |
| 31 | |
|
| 32 | 0 | ((MainFrame) getFrame()).updateContent(); |
| 33 | 0 | } |
| 34 | |
} |