mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
"Select All" menu option from the component tree context menu doesn't
work
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2426,6 +2426,10 @@
|
|||||||
<changeType>BUG_FIX</changeType>
|
<changeType>BUG_FIX</changeType>
|
||||||
<description>Drag&Drop from the tree sometimes picks up a wrong component type</description>
|
<description>Drag&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>
|
||||||
|
|||||||
Reference in New Issue
Block a user