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

Last change on this file since 23324 was 23324, checked in by postfix, 14 years ago

TabManager added in smed

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.TabManager;
13import smed.plug.ifc.SmedPluggable;
14import smed.tabs.SmedTabbedPane;
15
16public class SmedMenuBar extends JMenuBar {
17
18 /**
19 *
20 */
21 private static final long serialVersionUID = 1L;
22
23 JMenuBar menuBar;
24 JMenu menu, submenu;
25 JMenuItem menuItem;
26 private List<SmedPluggable> plugins = 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("Tabmanager",
37 KeyEvent.VK_T);
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 plugins = SmedTabbedPane.getPlugins();
44
45 for(SmedPluggable p : plugins) myModel.addElement (p.getName());
46
47 new TabManager(myModel);
48 }
49 });
50
51
52 menu.add(menuItem);
53
54 menuBar.add(menu);
55
56 add(menuBar);
57 }
58
59}
Note: See TracBrowser for help on using the repository browser.