FilterEditor<MatchVariableConstraint> () { return new FilterEditor<>(myTable.getMatchVariable(), myTable.getConstraintChangedCallback()) { private final JLabel myLabel = new JLabel(SSRBundle.message("reference.label")); private final @NotNull ComboBox<Configuration> myComboBox = new ComboBox<>(new CollectionComboBoxModel<>(ConfigurationManager.getInstance(myTable.getProject()).getAllConfigurations())); private final SimpleListCellRenderer<Configuration> renderer = new SimpleListCellRenderer<>() { @Override public void customize(@NotNull JList list, Configuration value, int index, boolean selected, boolean hasFocus) { setIcon(value.getIcon()); setText(value.getName()); } }; private final ContextHelpLabel myHelpLabel = ContextHelpLabel.create(SSRBundle.message("reference.filter.help.text")); private final CheckBox myCheckBox = new CheckBox(SSRBundle.message("invert.filter"), this, "inverseTemplate"); private final Component myGlue = Box.createGlue(); public boolean inverseTemplate = myConstraint.isInvertReference(); @Override protected void layoutComponents() { myComboBox.setRenderer(renderer); myComboBox.setPreferredSize(new Dimension(160, 28)); myComboBox.setSwingPopup(false); final GroupLayout layout = new GroupLayout(this); setLayout(layout); layout.setAutoCreateContainerGaps(true); layout.setHorizontalGroup( layout.createParallelGroup() .addGroup(layout.createSequentialGroup() .addComponent(myLabel) .addComponent(myComboBox) ) .addGroup(layout.createSequentialGroup() .addComponent(myCheckBox) .addComponent(myGlue) .addComponent(myHelpLabel) ) ); layout.setVerticalGroup( layout.createSequentialGroup() .addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER) .addComponent(myLabel) .addComponent(myComboBox) ) .addGroup(layout.createParallelGroup(GroupLayout.Alignment.CENTER) .addComponent(myCheckBox) .addComponent(myGlue) .addComponent(myHelpLabel) ) ); } @Override protected void loadValues() { inverseTemplate = myConstraint.isInvertReference(); myCheckBox.setSelected(inverseTemplate); var referencedTemplate = ConfigurationManager.getInstance(myTable.getProject()).findConfigurationByName(myConstraint.getReferenceConstraint()); if (referencedTemplate != null) { myComboBox.setSelectedItem(referencedTemplate); } } @Override protected void saveValues() { final Configuration item = myComboBox.getItem(); if (item != null) { myConstraint.setReferenceConstraint(item.getRefName()); myConstraint.setReferenceConstraintName(item.getName()); myConstraint.setInvertReference(inverseTemplate); } } @Override public JComponent getPreferredFocusedComponent() { return myComboBox; } @Override public JComponent[] getFocusableComponents() { return new JComponent[]{myComboBox, myCheckBox}; } }; }