1 | |
|
2 | |
|
3 | |
|
4 | |
package org.homeunix.thecave.buddi.view.menu.menus; |
5 | |
|
6 | |
import java.awt.event.ActionEvent; |
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.view.menu.items.WindowEntry; |
11 | |
import org.homeunix.thecave.buddi.view.menu.items.WindowMinimize; |
12 | |
|
13 | |
import ca.digitalcave.moss.swing.ApplicationModel; |
14 | |
import ca.digitalcave.moss.swing.MossFrame; |
15 | |
import ca.digitalcave.moss.swing.MossMenu; |
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
public class WindowMenu extends MossMenu { |
25 | |
public static final long serialVersionUID = 0; |
26 | |
|
27 | |
public WindowMenu(MossFrame frame) { |
28 | 5975 | super(frame, PrefsModel.getInstance().getTranslator().get(MenuKeys.MENU_WINDOW)); |
29 | 5975 | } |
30 | |
|
31 | |
public void actionPerformed(ActionEvent e) { |
32 | 0 | updateMenus(); |
33 | 0 | } |
34 | |
|
35 | |
@Override |
36 | |
public void updateMenus() { |
37 | 42468 | super.updateMenus(); |
38 | |
|
39 | 42468 | this.removeAll(); |
40 | |
|
41 | 42468 | this.add(new WindowMinimize(getFrame())); |
42 | 42468 | this.addSeparator(); |
43 | |
|
44 | 42468 | for (MossFrame targetFrame : ApplicationModel.getInstance().getOpenFrames()) { |
45 | 45012 | this.add(new WindowEntry(getFrame(), targetFrame)); |
46 | |
} |
47 | 42468 | } |
48 | |
} |