comparison src/name/blackcap/clipman/Menus.kt @ 36:fcf82e3b7e31

Remove deadwood.
author David Barts <n5jrn@me.com>
date Thu, 30 Jan 2020 20:24:02 -0800
parents 5f8475b37e23
children 2a5808156f99
comparison
equal deleted inserted replaced
35:5f8475b37e23 36:fcf82e3b7e31
58 * Track menu items that require something to be selected in order 58 * Track menu items that require something to be selected in order
59 * to work, and allow them to be enabled and disabled en masse. 59 * to work, and allow them to be enabled and disabled en masse.
60 */ 60 */
61 class SelectionRequired { 61 class SelectionRequired {
62 private val controls = HashSet<JMenuItem>() 62 private val controls = HashSet<JMenuItem>()
63 /* private val parents = HashSet<Container>() */
64 63
65 fun add(item: JMenuItem): JMenuItem { 64 fun add(item: JMenuItem): JMenuItem {
66 controls.add(item) 65 controls.add(item)
67 /* var p = item.parent
68 if (p != null) {
69 parents.add(p)
70 } */
71 return item 66 return item
72 } 67 }
73 68
74 private fun setEnabled(state: Boolean) { 69 private fun setEnabled(state: Boolean) {
75 controls.forEach { 70 controls.forEach {
76 it.setEnabled(state) 71 it.setEnabled(state)
77 } 72 }
78 /* parents.forEach {
79 it.validate()
80 } */
81 } 73 }
82 74
83 fun enable() = setEnabled(true) 75 fun enable() = setEnabled(true)
84 76
85 fun disable() = setEnabled(false) 77 fun disable() = setEnabled(false)