diff --git a/iped-app/src/main/java/iped/app/ui/FiltersPanel.java b/iped-app/src/main/java/iped/app/ui/FiltersPanel.java index 43dbbe2f59..c1cd064934 100644 --- a/iped-app/src/main/java/iped/app/ui/FiltersPanel.java +++ b/iped-app/src/main/java/iped/app/ui/FiltersPanel.java @@ -140,6 +140,11 @@ public void actionPerformed(ActionEvent e) { filterer.restoreDefinedFilters(clastFilters); App.get().getAppListener().updateFileListing(); App.get().filtersPanel.updateUI(); + } else { + CheckBoxTreeCellRenderer.TreeCellCheckBoxActionEvent te = (CheckBoxTreeCellRenderer.TreeCellCheckBoxActionEvent) e; + if (te.getCheckBox().isSelected()) { + te.getCheckBox().setSelected(false); + } } } } diff --git a/iped-app/src/main/java/iped/app/ui/controls/CheckBoxTreeCellRenderer.java b/iped-app/src/main/java/iped/app/ui/controls/CheckBoxTreeCellRenderer.java index 479fdbc495..9c0b7baa33 100644 --- a/iped-app/src/main/java/iped/app/ui/controls/CheckBoxTreeCellRenderer.java +++ b/iped-app/src/main/java/iped/app/ui/controls/CheckBoxTreeCellRenderer.java @@ -57,6 +57,20 @@ public String getValueString(Object value) { return value.toString(); } + public class TreeCellCheckBoxActionEvent extends ActionEvent { + JCheckBox checkBox = null; + + public TreeCellCheckBoxActionEvent(JCheckBox checkBox, Object source, int id, String command) { + super(source, id, command); + this.checkBox = checkBox; + } + + public JCheckBox getCheckBox() { + return checkBox; + } + + } + @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { @@ -87,8 +101,9 @@ public Component getTreeCellRendererComponent(JTree tree, Object value, boolean checkbox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - e.setSource(value); - al.actionPerformed(e); + al.actionPerformed( + new TreeCellCheckBoxActionEvent(checkbox, value, e.getID(), + e.getActionCommand())); } }); }