| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| FileSynchronizeMenu |
|
| 2.5;2.5 |
| 1 | /* | |
| 2 | * Created on Aug 7, 2007 by wyatt | |
| 3 | */ | |
| 4 | package org.homeunix.thecave.buddi.view.menu.menus; | |
| 5 | ||
| 6 | import java.util.List; | |
| 7 | ||
| 8 | import org.homeunix.thecave.buddi.i18n.keys.MenuKeys; | |
| 9 | import org.homeunix.thecave.buddi.model.prefs.PrefsModel; | |
| 10 | import org.homeunix.thecave.buddi.plugin.BuddiPluginFactory; | |
| 11 | import org.homeunix.thecave.buddi.plugin.api.BuddiSynchronizePlugin; | |
| 12 | import org.homeunix.thecave.buddi.view.menu.items.PluginMenuEntry; | |
| 13 | ||
| 14 | import ca.digitalcave.moss.swing.MossDocumentFrame; | |
| 15 | import ca.digitalcave.moss.swing.MossFrame; | |
| 16 | import ca.digitalcave.moss.swing.MossMenu; | |
| 17 | ||
| 18 | public class FileSynchronizeMenu extends MossMenu { | |
| 19 | public static final long serialVersionUID = 0; | |
| 20 | ||
| 21 | public FileSynchronizeMenu(MossFrame frame) { | |
| 22 | 5975 | super(frame, PrefsModel.getInstance().getTranslator().get(MenuKeys.MENU_FILE_SYNCHRONIZE)); |
| 23 | 5975 | } |
| 24 | ||
| 25 | @SuppressWarnings("unchecked") | |
| 26 | @Override | |
| 27 | public void updateMenus() { | |
| 28 | 42468 | this.removeAll(); |
| 29 | ||
| 30 | 42468 | for (BuddiSynchronizePlugin plugin : (List<BuddiSynchronizePlugin>) BuddiPluginFactory.getPlugins(BuddiSynchronizePlugin.class)) { |
| 31 | 0 | if (getFrame() instanceof MossDocumentFrame) |
| 32 | 0 | this.add(new PluginMenuEntry((MossDocumentFrame) getFrame(), plugin)); |
| 33 | } | |
| 34 | ||
| 35 | 42468 | this.setEnabled(getFrame() instanceof MossDocumentFrame && this.getComponentCount() > 0); |
| 36 | ||
| 37 | 42468 | super.updateMenus(); |
| 38 | 42468 | } |
| 39 | } |