UnnamedConfigurable (Couple<TemplateResource> item) { final GenerateTemplateConfigurable equalsConfigurable = new GenerateTemplateConfigurable(item.first, GenerateEqualsHelper.getEqualsImplicitVars(myProject), myProject); final GenerateTemplateConfigurable hashCodeConfigurable = new GenerateTemplateConfigurable(item.second, GenerateEqualsHelper.getHashCodeImplicitVars(), myProject); return new UnnamedConfigurable() { @Override public @NotNull JComponent createComponent() { final Splitter splitter = new Splitter(true); final JPanel eqPanel = new JPanel(new BorderLayout()); eqPanel.add(new TitledSeparator(JavaBundle.message("generate.equals.template.title")), BorderLayout.NORTH); final JComponent eqPane = equalsConfigurable.createComponent(); eqPane.setPreferredSize(JBUI.size(300, 200)); eqPanel.add(eqPane, BorderLayout.CENTER); splitter.setFirstComponent(eqPanel); final JPanel hcPanel = new JPanel(new BorderLayout()); hcPanel.add(new TitledSeparator(JavaBundle.message("generate.hashcode.template.title")), BorderLayout.NORTH); final JComponent hcPane = hashCodeConfigurable.createComponent(); hcPane.setPreferredSize(JBUI.size(300, 200)); hcPanel.add(hcPane, BorderLayout.CENTER); splitter.setSecondComponent(hcPanel); return splitter; } @Override public boolean isModified() { return equalsConfigurable.isModified() || hashCodeConfigurable.isModified(); } @Override public void apply() throws ConfigurationException { equalsConfigurable.apply(); hashCodeConfigurable.apply(); } @Override public void reset() { equalsConfigurable.reset(); hashCodeConfigurable.reset(); } @Override public void disposeUIResources() { equalsConfigurable.disposeUIResources(); hashCodeConfigurable.disposeUIResources(); } }; }