JComponent () { PanelGridBuilder builder = UI.PanelFactory.grid(); builder.add(UI.PanelFactory.panel(mySubclassButton).withLabel(JavaBundle.message("label.implementation"))) .add(UI.PanelFactory.panel(myProviderButton)); if (myRootDirCombo.getModel().getSize() > 1) { builder.add(UI.PanelFactory.panel(myRootDirCombo).withLabel(CommonBundle.message("label.source.root") + ":")); } return builder.createPanel(); }