"Select All" menu option from the component tree context menu doesn't

work
This commit is contained in:
Branislav Stojkovic
2019-02-08 10:29:23 +01:00
parent 0cb4377830
commit 7597143b1b
2 changed files with 11 additions and 6 deletions
@@ -459,7 +459,7 @@ public class TreePanel extends JPanel {
} }
if (componentType != null) { if (componentType != null) {
popup.add(new SelectAllAction(plugInPort)); popup.add(new SelectAllAction(plugInPort, componentType));
popup.add(shortcutSubmenu); popup.add(shortcutSubmenu);
popup.add(new JSeparator()); popup.add(new JSeparator());
@@ -711,18 +711,20 @@ public class TreePanel extends JPanel {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private IPlugInPort plugInPort; private IPlugInPort plugInPort;
private ComponentType componentType;
public SelectAllAction(IPlugInPort plugInPort) { public SelectAllAction(IPlugInPort plugInPort, ComponentType componentType) {
super(); super();
this.plugInPort = plugInPort; this.plugInPort = plugInPort;
this.componentType = componentType;
putValue(AbstractAction.NAME, "Select All"); putValue(AbstractAction.NAME, "Select All");
} }
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
LOG.info(getValue(AbstractAction.NAME) + " triggered"); LOG.info(getValue(AbstractAction.NAME) + " triggered");
ComponentType componentType = plugInPort.getNewComponentTypeSlot();
if (componentType != null) { if (componentType != null) {
plugInPort.setNewComponentTypeSlot(null, null, false);
List<IDIYComponent<?>> components = plugInPort.getCurrentProject().getComponents(); List<IDIYComponent<?>> components = plugInPort.getCurrentProject().getComponents();
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>(); List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>();
for (IDIYComponent<?> component : components) { for (IDIYComponent<?> component : components) {
@@ -732,7 +734,6 @@ public class TreePanel extends JPanel {
} }
plugInPort.updateSelection(newSelection); plugInPort.updateSelection(newSelection);
plugInPort.setNewComponentTypeSlot(null, null, false);
plugInPort.refresh(); plugInPort.refresh();
} }
} }
+4
View File
@@ -2426,6 +2426,10 @@
<changeType>BUG_FIX</changeType> <changeType>BUG_FIX</changeType>
<description>Drag&amp;Drop from the tree sometimes picks up a wrong component type</description> <description>Drag&amp;Drop from the tree sometimes picks up a wrong component type</description>
</org.diylc.appframework.update.Change> </org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType>
<description>"Select All" menu option from the component tree context menu doesn't work</description>
</org.diylc.appframework.update.Change>
<org.diylc.appframework.update.Change> <org.diylc.appframework.update.Change>
<changeType>BUG_FIX</changeType> <changeType>BUG_FIX</changeType>
<description>Components do not load if the installation directory name contains a special character, like '!'</description> <description>Components do not load if the installation directory name contains a special character, like '!'</description>