FilterEditor<MatchVariableConstraint> () { return new FilterEditor<>(myTable.getMatchVariable(), myTable.getConstraintChangedCallback()) { private final JLabel myLabel = new JLabel(SSRBundle.message("context.label")); private final TextFieldWithAutoCompletion<String> textField = TextFieldWithAutoCompletion.create(myTable.getProject(), Collections.emptyList(), false, ""); private final String shortcut = KeymapUtil.getFirstKeyboardShortcutText(ActionManager.getInstance().getAction(IdeActions.ACTION_CODE_COMPLETION)); private final ContextHelpLabel myHelpLabel = ContextHelpLabel.create(SSRBundle.message("tooltip.preconfigured.search.patterns", shortcut)); @Override protected void layoutComponents() { final ConfigurationManager configManager = ConfigurationManager.getInstance(myTable.getProject()); final StructuralSearchProfile profile = myTable.getProfile(); assert profile != null; final List<String> configurationNames = JBIterable .from(configManager.getAllConfigurationNames()) .filter(name -> { final Configuration config = configManager.findConfigurationByName(name); return config != null && profile.isApplicableContextConfiguration(config); }) .toList(); textField.setVariants(configurationNames); final GroupLayout layout = new GroupLayout(this); setLayout(layout); layout.setAutoCreateContainerGaps(true); layout.setHorizontalGroup( layout.createSequentialGroup() .addComponent(myLabel) .addComponent(textField) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 1, 1) .addComponent(myHelpLabel) ); layout.setVerticalGroup( layout.createParallelGroup(GroupLayout.Alignment.CENTER) .addComponent(myLabel) .addComponent(textField) .addComponent(myHelpLabel) ); } @Override protected void loadValues() { textField.setText(myConstraint.getContextConstraint()); } @Override protected void saveValues() { myConstraint.setContextConstraint(textField.getText()); } @Override public JComponent getPreferredFocusedComponent() { return textField; } @Override public JComponent[] getFocusableComponents() { return new JComponent[]{textField}; } }; }