FilterEditor<MatchVariableConstraint> () { return new FilterEditor<>(myTable.getMatchVariable(), myTable.getConstraintChangedCallback()) { private final EditorTextField myTextField = UIUtil.createRegexComponent("", myTable.getProject()); private final JCheckBox myHierarchyCheckBox = new JCheckBox(SSRBundle.message("within.type.hierarchy.check.box"), false); private final JLabel myTextLabel = new JLabel(SSRBundle.message("text.label")); private final ContextHelpLabel myHelpLabel = ContextHelpLabel.create(SSRBundle.message("text.filter.help.text")); @Override protected void layoutComponents() { final GroupLayout layout = new GroupLayout(this); setLayout(layout); layout.setAutoCreateContainerGaps(true); layout.setHorizontalGroup( layout.createParallelGroup() .addGroup( layout.createSequentialGroup() .addComponent(myTextLabel) .addComponent(myTextField) .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 1, 1) .addComponent(myHelpLabel) ) .addGroup( layout.createSequentialGroup() .addComponent(myHierarchyCheckBox) ) ); layout.setVerticalGroup( layout.createSequentialGroup() .addGroup( layout.createParallelGroup(GroupLayout.Alignment.CENTER) .addComponent(myTextLabel) .addComponent(myTextField) .addComponent(myHelpLabel) ) .addGroup( layout.createParallelGroup(GroupLayout.Alignment.CENTER) .addComponent(myHierarchyCheckBox) ) ); } @Override protected void loadValues() { myTextField.setText((myConstraint.isInvertRegExp() ? "!" : "") + myConstraint.getRegExp()); myHierarchyCheckBox.setSelected(myConstraint.isWithinHierarchy()); myHierarchyCheckBox.setVisible(myShowHierarchy); } @Override public void saveValues() { final String text = myTextField.getText(); if (text.startsWith("!")) { myConstraint.setRegExp(text.substring(1)); myConstraint.setInvertRegExp(true); } else { myConstraint.setRegExp(text); myConstraint.setInvertRegExp(false); } myConstraint.setWholeWordsOnly(false); myConstraint.setWithinHierarchy(myHierarchyCheckBox.isSelected()); } @Override public JComponent getPreferredFocusedComponent() { return myTextField; } @Override public JComponent[] getFocusableComponents() { return new JComponent[]{myTextField}; } }; }