source: osm/applications/editors/josm/plugins/smed/src/smed/menu/SmedMenuBar.java@ 23288

Last change on this file since 23288 was 23288, checked in by postfix, 15 years ago

CheckBoxJList added

File size: 1.3 KB
Line 
1package smed.menu;
2
3import java.awt.event.KeyEvent;
4import java.util.ArrayList;
5import java.util.List;
6
7import javax.swing.DefaultListModel;
8import javax.swing.JMenu;
9import javax.swing.JMenuBar;
10import javax.swing.JMenuItem;
11
12import smed.menu.file.HideAction;
13import smed.plug.ifc.SmedPluggable;
14
15public class SmedMenuBar extends JMenuBar {
16
17 /**
18 *
19 */
20 private static final long serialVersionUID = 1L;
21
22 JMenuBar menuBar;
23 JMenu menu, submenu;
24 JMenuItem menuItem;
25 public List<SmedPluggable> plugins = null;
26 HideAction hideAction = null;
27
28 public SmedMenuBar() {
29 menuBar = new JMenuBar();
30
31 menu = new JMenu("File");
32 menu.setMnemonic(KeyEvent.VK_F);
33 menu.getAccessibleContext().setAccessibleDescription(
34 "The only menu in this program that has menu items");
35
36 menuItem = new JMenuItem("Hide",
37 KeyEvent.VK_H);
38
39 menuItem.addActionListener(new java.awt.event.ActionListener() {
40
41 public void actionPerformed(java.awt.event.ActionEvent e) {
42 DefaultListModel myModel = new DefaultListModel();
43
44 for(SmedPluggable p : plugins) myModel.addElement (p.getName());
45
46 hideAction = new HideAction(myModel);
47 }
48 });
49
50
51 menu.add(menuItem);
52
53 menuBar.add(menu);
54
55 add(menuBar);
56 }
57
58}
Note: See TracBrowser for help on using the repository browser.