mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-28 19:05:35 +00:00
Added #1898 Keyboard shortcut to remove tags (DEL, SHIFT+DEL)
This commit is contained in:
@@ -511,6 +511,21 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
|
||||
|
||||
private void handleTreeKeyPressed(KeyEvent e) {
|
||||
AbstractTagTree tree = (AbstractTagTree) e.getSource();
|
||||
if ((e.getKeyCode() == KeyEvent.VK_DELETE) && !e.isControlDown() && !e.isAltDown()) {
|
||||
TreePath[] paths = tree.getSelectionPaths();
|
||||
if (paths == null || paths.length == 0) {
|
||||
return;
|
||||
}
|
||||
List<TreeItem> items = new ArrayList<>();
|
||||
for (TreePath treePath : paths) {
|
||||
TreeItem item = (TreeItem) treePath.getLastPathComponent();
|
||||
items.add(item);
|
||||
}
|
||||
if (contextPopupMenu.canRemove(items)) {
|
||||
contextPopupMenu.update(items);
|
||||
contextPopupMenu.removeItemActionPerformed(null, e.isShiftDown());
|
||||
}
|
||||
}
|
||||
if ((e.getKeyCode() == 'C' || e.getKeyCode() == 'X') && (e.isControlDown())) {
|
||||
TreePath[] paths = tree.getSelectionPaths();
|
||||
if (paths == null || paths.length == 0) {
|
||||
|
||||
Reference in New Issue
Block a user