From 7597143b1b19bd55e4ad2a910117e7d2bca21a56 Mon Sep 17 00:00:00 2001 From: Branislav Stojkovic Date: Fri, 8 Feb 2019 10:29:23 +0100 Subject: [PATCH] "Select All" menu option from the component tree context menu doesn't work --- .../src/org/diylc/swing/plugins/tree/TreePanel.java | 13 +++++++------ diylc/diylc-swing/update.xml | 4 ++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java index 08feeb64..8e72dc1e 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java +++ b/diylc/diylc-swing/src/org/diylc/swing/plugins/tree/TreePanel.java @@ -459,7 +459,7 @@ public class TreePanel extends JPanel { } if (componentType != null) { - popup.add(new SelectAllAction(plugInPort)); + popup.add(new SelectAllAction(plugInPort, componentType)); popup.add(shortcutSubmenu); popup.add(new JSeparator()); @@ -711,18 +711,20 @@ public class TreePanel extends JPanel { private static final long serialVersionUID = 1L; private IPlugInPort plugInPort; + private ComponentType componentType; - public SelectAllAction(IPlugInPort plugInPort) { + public SelectAllAction(IPlugInPort plugInPort, ComponentType componentType) { super(); this.plugInPort = plugInPort; + this.componentType = componentType; putValue(AbstractAction.NAME, "Select All"); } @Override public void actionPerformed(ActionEvent e) { - LOG.info(getValue(AbstractAction.NAME) + " triggered"); - ComponentType componentType = plugInPort.getNewComponentTypeSlot(); + LOG.info(getValue(AbstractAction.NAME) + " triggered"); if (componentType != null) { + plugInPort.setNewComponentTypeSlot(null, null, false); List> components = plugInPort.getCurrentProject().getComponents(); List> newSelection = new ArrayList>(); for (IDIYComponent component : components) { @@ -731,8 +733,7 @@ public class TreePanel extends JPanel { } } - plugInPort.updateSelection(newSelection); - plugInPort.setNewComponentTypeSlot(null, null, false); + plugInPort.updateSelection(newSelection); plugInPort.refresh(); } } diff --git a/diylc/diylc-swing/update.xml b/diylc/diylc-swing/update.xml index 273ddedc..901c05ae 100644 --- a/diylc/diylc-swing/update.xml +++ b/diylc/diylc-swing/update.xml @@ -2426,6 +2426,10 @@ BUG_FIX Drag&Drop from the tree sometimes picks up a wrong component type + + BUG_FIX + "Select All" menu option from the component tree context menu doesn't work + BUG_FIX Components do not load if the installation directory name contains a special character, like '!'