ActionGroup (ActionGroup origin, @NotNull JComponent searchComponent) { var filterAction = new ToggleSearchFilterAction() { @Override protected @NotNull JComponent getSearchFilterComponent() { return searchComponent; } @Override protected boolean isModified(@NotNull JComponent component) { if (myLogFilterCombo.getSelectedIndex() > 0) { return true; } var textFilterComponent = getTextFilterComponent(); if (textFilterComponent instanceof FilterComponent) { String filterText = ((FilterComponent)textFilterComponent).getFilter(); return StringUtil.isNotEmpty(filterText); } return false; } }; return new DefaultActionGroup(origin, filterAction); }