annotate src/name/blackcap/clipman/Menus.kt @ 37:9890445e4cc4

Didn't like eating its own dog food. Fixed.
author David Barts <n5jrn@me.com>
date Thu, 30 Jan 2020 21:03:56 -0800
parents fcf82e3b7e31
children 2a5808156f99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
1 /*
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
2 * Menu-related stuff, pertaining to both the menu bar and popup menus.
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
3 */
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
4 package name.blackcap.clipman
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
5
35
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
6 import java.awt.Container
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
7 import java.awt.Toolkit
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
8 import java.awt.event.ActionEvent
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
9 import java.awt.event.ActionListener
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
10 import java.awt.event.KeyEvent
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
11 import javax.swing.*
35
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
12 import kotlin.collections.HashSet
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
13
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
14 /**
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
15 * Listen to actionEvents from both menu bar and popup menu selections.
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
16 */
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
17 class MenuItemListener: ActionListener {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
18 override fun actionPerformed(e: ActionEvent) {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
19 when (e.actionCommand) {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
20 "File.Quit" -> System.exit(0)
30
0e88c6bed11e Remove the troublesome delete command(s).
David Barts <n5jrn@me.com>
parents: 28
diff changeset
21 "Edit.Clone" -> onlyIfSelected { PasteboardItem.write(it.contents) }
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
22 "Edit.Coerce" -> onlyIfSelected { coerceDialog.setVisible(true) }
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
23 "Edit.Find" -> searchDialog.setVisible(true)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
24 "Edit.FindAgain" -> searchDialog.find()
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
25 else -> throw RuntimeException("unexpected actionCommand!")
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
26 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
27 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
28
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
29 private fun onlyIfSelected(block: (QueueItem) -> Unit) {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
30 val selected = queue.v.getSelected()
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
31 if (selected == null) {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
32 JOptionPane.showMessageDialog(frame.v,
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
33 "No item selected.",
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
34 "Error",
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
35 JOptionPane.ERROR_MESSAGE)
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
36 } else {
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
37 block(selected)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
38 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
39 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
40
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
41 private fun clone(contents: PasteboardItem) {
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
42 val (plain, html) = when(contents) {
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
43 is PasteboardItem.Plain -> Pair(contents.plain, null)
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
44 is PasteboardItem.HTML -> Pair(contents.plain, contents.html)
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
45 is PasteboardItem.RTF -> Pair(contents.plain, contents.html)
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
46 }
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
47 if (html == null) {
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
48 PasteboardItem.write(PasteboardItem.Plain(plain))
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
49 } else {
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
50 PasteboardItem.write(PasteboardItem.HTML(plain, scrub(html)))
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
51 }
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
52 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
53 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
54
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
55 val menuItemListener = MenuItemListener()
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
56
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
57 /**
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
58 * Track menu items that require something to be selected in order
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
59 * to work, and allow them to be enabled and disabled en masse.
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
60 */
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
61 class SelectionRequired {
35
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
62 private val controls = HashSet<JMenuItem>()
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
63
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
64 fun add(item: JMenuItem): JMenuItem {
35
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
65 controls.add(item)
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
66 return item
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
67 }
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
68
35
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
69 private fun setEnabled(state: Boolean) {
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
70 controls.forEach {
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
71 it.setEnabled(state)
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
72 }
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
73 }
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
74
35
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
75 fun enable() = setEnabled(true)
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
76
5f8475b37e23 Got it correctly enabling and disabling menu items.
David Barts <n5jrn@me.com>
parents: 31
diff changeset
77 fun disable() = setEnabled(false)
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
78 }
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
79
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
80 val anyRequired = SelectionRequired()
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
81 val styledRequired = SelectionRequired()
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
82
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
83 /**
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
84 * Our menu bar. What we display depends somewhat on the system type, as
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
85 * the Mac gives us a gratuitous menu bar entry for handling some stuff.
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
86 */
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
87 class MyMenuBar: JMenuBar() {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
88 init {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
89 if (OS.type != OS.MAC) {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
90 add(JMenu("File").apply {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
91 add(JMenuItem("Quit").apply {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
92 actionCommand = "File.Quit"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
93 addActionListener(menuItemListener)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
94 makeShortcut(KeyEvent.VK_Q)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
95 })
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
96 })
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
97 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
98 add(JMenu("Edit").apply {
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
99 add(anyRequired.add(JMenuItem("Clone").apply {
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
100 setEnabled(false)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
101 actionCommand = "Edit.Clone"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
102 addActionListener(menuItemListener)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
103 makeShortcut(KeyEvent.VK_C)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
104 }))
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
105 add(styledRequired.add(JMenuItem("Coerce…").apply {
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
106 setEnabled(false)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
107 actionCommand = "Edit.Coerce"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
108 addActionListener(menuItemListener)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
109 makeShortcut(KeyEvent.VK_K)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
110 }))
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
111 add(JMenuItem("Find…").apply {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
112 actionCommand = "Edit.Find"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
113 addActionListener(menuItemListener)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
114 makeShortcut(KeyEvent.VK_F)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
115 })
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
116 add(JMenuItem("Find Again").apply {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
117 actionCommand = "Edit.FindAgain"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
118 addActionListener(menuItemListener)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
119 makeShortcut(KeyEvent.VK_G)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
120 })
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
121 })
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
122 if (OS.type != OS.MAC) {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
123 add(JMenu("Help").apply {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
124 add(JMenuItem("About ClipMan…").apply {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
125 actionCommand = "Help.About"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
126 addActionListener(menuItemListener)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
127 })
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
128 })
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
129 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
130 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
131
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
132 fun getMenu(name: String): JMenu? {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
133 subElements.forEach {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
134 val jmenu = it.component as? JMenu
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
135 if (jmenu?.text == name) {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
136 return jmenu
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
137 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
138 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
139 return null
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
140 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
141 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
142
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
143 val menuBar = MyMenuBar()
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
144
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
145 /**
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
146 * The popup menu we display when the user requests so atop a clipboard
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
147 * item.
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
148 */
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
149 class MyPopupMenu: JPopupMenu() {
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
150 init {
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
151 add(anyRequired.add(JMenuItem("Clone").apply {
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
152 actionCommand = "Edit.Clone"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
153 addActionListener(menuItemListener)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
154 }))
31
0c6c18a733b7 Compiles, new menu still a mess.
David Barts <n5jrn@me.com>
parents: 30
diff changeset
155 add(styledRequired.add(JMenuItem("Coerce…").apply {
27
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
156 actionCommand = "Edit.Coerce"
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
157 addActionListener(menuItemListener)
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
158 }))
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
159 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
160 }
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
161
8aa2dfac27eb Big reorg; compiled but untested.
David Barts <n5jrn@me.com>
parents:
diff changeset
162 val popupMenu = MyPopupMenu()