From d25cddaeebf6bd855018bbb5e4e165f067f1bf52 Mon Sep 17 00:00:00 2001 From: Dmitry Cherniachenko Date: Thu, 13 Apr 2017 17:06:59 +0300 Subject: [PATCH] IDEA-140862 Changed the "Regex" checkbox ChangeListener to ItemListener The only change they actually need is the selection change. Also add a mnemonic. https://github.com/JetBrains/intellij-community/pull/540 --- .../src/messages/VcsBundle.properties | 2 +- .../vcs/changes/committed/CommittedChangesPanel.java | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/platform-resources-en/src/messages/VcsBundle.properties b/platform/platform-resources-en/src/messages/VcsBundle.properties index d699c9bb44a9..f9e766056ddd 100644 --- a/platform/platform-resources-en/src/messages/VcsBundle.properties +++ b/platform/platform-resources-en/src/messages/VcsBundle.properties @@ -466,7 +466,7 @@ outdated.version.text.deleted=Outdated version. Deleted by {0} {1}: {2} current.version.text={4}

Current version is {3}.
Modified by {0}
{1}
{2} committed.changes.filter.title=Filter by committed.changes.group.title=Group by -committed.changes.regex.title=Regex +committed.changes.regex.title=Re&gex changelist.details.committed.format=Committed by {0} {1} incoming.changes.indicator.tooltip={0} incoming changelists available column.name.type=Type diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesPanel.java index 03531473af9a..29d7048ceee8 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesPanel.java @@ -52,6 +52,8 @@ import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; @@ -103,9 +105,10 @@ public class CommittedChangesPanel extends JPanel implements TypeSafeDataProvide toolbarPanel.add(Box.createHorizontalGlue()); myRegexCheckbox = new JCheckBox(VcsBundle.message("committed.changes.regex.title")); myRegexCheckbox.setSelected(false); - myRegexCheckbox.getModel().addChangeListener(new ChangeListener() { + myRegexCheckbox.getModel().addItemListener(new ItemListener() { @Override - public void stateChanged(ChangeEvent e) { + public void itemStateChanged(ItemEvent e) { + // TODO: no need to re-filter if the text field is empty anyway myFilterComponent.filter(); } });