diff src/name/blackcap/clipman/Menus.kt @ 30:0e88c6bed11e

Remove the troublesome delete command(s).
author David Barts <n5jrn@me.com>
date Wed, 29 Jan 2020 21:56:12 -0800
parents f1fcc1281dad
children 0c6c18a733b7
line wrap: on
line diff
--- a/src/name/blackcap/clipman/Menus.kt	Wed Jan 29 14:36:16 2020 -0800
+++ b/src/name/blackcap/clipman/Menus.kt	Wed Jan 29 21:56:12 2020 -0800
@@ -17,12 +17,8 @@
     override fun actionPerformed(e: ActionEvent) {
         when (e.actionCommand) {
             "File.Quit" -> System.exit(0)
-            "Edit.Clone" -> onlyIfSelected { queue.v.add(it) }
+            "Edit.Clone" -> onlyIfSelected { PasteboardItem.write(it.contents) }
             "Edit.Coerce" -> onlyIfSelected { doCoerceFonts(it) }
-            "Edit.Delete" -> onlyIfSelected {
-                queue.v.delete(it)
-                SelectionRequired.disable()
-            }
             "Edit.Find" -> searchDialog.setVisible(true)
             "Edit.FindAgain" -> searchDialog.find()
             else -> throw RuntimeException("unexpected actionCommand!")
@@ -76,12 +72,6 @@
                 addActionListener(menuItemListener)
                 makeShortcut(KeyEvent.VK_K)
             }))
-            add(SelectionRequired.add(JMenuItem("Delete").apply {
-                setEnabled(false)
-                actionCommand = "Edit.Delete"
-                addActionListener(menuItemListener)
-                setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0))
-            }))
             add(JMenuItem("Find…").apply {
                 actionCommand = "Edit.Find"
                 addActionListener(menuItemListener)
@@ -130,10 +120,6 @@
             actionCommand = "Edit.Coerce"
             addActionListener(menuItemListener)
         }))
-        add(SelectionRequired.add(JMenuItem("Delete").apply {
-            actionCommand = "Edit.Delete"
-            addActionListener(menuItemListener)
-        }))
     }
 }