void (final Project project) { myProject = project; MyAddActionButtonRunnable addActionButtonRunnable = new MyAddActionButtonRunnable(); myTableView = new JsonMappingsTableView(addActionButtonRunnable); myTableView.setShowGrid(false); myTableView.getTableHeader().setVisible(false); final ToolbarDecorator decorator = ToolbarDecorator.createDecorator(myTableView); final MyEditActionButtonRunnableImpl editAction = new MyEditActionButtonRunnableImpl(); decorator.setRemoveAction(new MyRemoveActionButtonRunnable()) .setRemoveActionName(REMOVE_SCHEMA_MAPPING) .setAddAction(addActionButtonRunnable) .setAddActionName(JsonBundle.message(ADD_SCHEMA_MAPPING)) .setEditAction(editAction) .setEditActionName(JsonBundle.message(EDIT_SCHEMA_MAPPING)) .disableUpDownActions(); JBTextField schemaFieldBacking = new JBTextField(); mySchemaField = new TextFieldWithBrowseButton(schemaFieldBacking); mySchemaField.setButtonIcon(AllIcons.General.OpenDiskHover); FixedSizeButton urlButton = new FixedSizeButton(); urlButton.setIcon(AllIcons.General.Web); urlButton.addActionListener(a -> { final JsonSchemaService service = JsonSchemaService.Impl.get(myProject); List<JsonSchemaInfo> schemas = service.getAllUserVisibleSchemas(); JBPopupFactory.getInstance().createListPopup(new JsonSchemaInfoPopupStep(schemas, myProject, null, service, JsonBundle.message("schema.configuration.mapping.remote")) { @Override protected void setMapping(@Nullable JsonSchemaInfo selectedValue, @Nullable VirtualFile virtualFile, @NotNull Project project) { if (selectedValue != null) { mySchemaField.setText(selectedValue.getUrl(myProject)); mySchemaPathChangedCallback.accept(selectedValue.getDescription(), true); // force updating name } } }).showInCenterOf(urlButton); }); SwingHelper.installFileCompletionAndBrowseDialog(myProject, mySchemaField, JsonBundle.message("json.schema.add.schema.chooser.title"), FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor()); mySchemaField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent e) { mySchemaPathChangedCallback.accept(mySchemaField.getText(), false); } }); attachNavigateToSchema(); myError = SwingHelper.createHtmlLabel(JsonBundle.message("json.schema.conflicting.mappings"), null, s -> { final BalloonBuilder builder = JBPopupFactory.getInstance(). createHtmlTextBalloonBuilder(myErrorText, UIUtil.getBalloonWarningIcon(), MessageType.WARNING.getPopupBackground(), null); builder.setDisposable(this); builder.setHideOnClickOutside(true); builder.setCloseButtonEnabled(true); builder.createBalloon().showInCenterOf(myError); }); JPanel schemaSelector = new JPanel(new BorderLayout()); schemaSelector.add(mySchemaField, BorderLayout.CENTER); schemaSelector.add(urlButton, BorderLayout.EAST); final FormBuilder builder = FormBuilder.createFormBuilder(); final JBLabel label = new JBLabel(JsonBundle.message("json.schema.file.selector.title")); builder.addLabeledComponent(label, schemaSelector); label.setLabelFor(schemaSelector); label.setBorder(JBUI.Borders.empty(0, 10)); schemaSelector.setBorder(JBUI.Borders.emptyRight(10)); JBLabel versionLabel = new JBLabel(JsonBundle.message("json.schema.version.selector.title")); mySchemaVersionComboBox = new ComboBox<>(new DefaultComboBoxModel<>(JsonSchemaVersion.values())); versionLabel.setLabelFor(mySchemaVersionComboBox); versionLabel.setBorder(JBUI.Borders.empty(0, 10)); builder.addLabeledComponent(versionLabel, mySchemaVersionComboBox); final JPanel wrapper = new JPanel(new BorderLayout()); wrapper.setBorder(JBUI.Borders.empty(0, 10)); myErrorIcon = new JBLabel(UIUtil.getBalloonWarningIcon()); wrapper.add(myErrorIcon, BorderLayout.WEST); wrapper.add(myError, BorderLayout.CENTER); builder.addComponent(wrapper); JPanel panel = decorator.createPanel(); panel.setBorder(BorderFactory.createCompoundBorder(JBUI.Borders.empty(0, 8), panel.getBorder())); builder.addComponentFillVertically(panel, 5); JLabel commentComponent = ComponentPanelBuilder.createCommentComponent( JsonBundle.message("path.to.file.or.directory.relative.to.project.root.or.file.name"), false); commentComponent.setBorder(JBUI.Borders.empty(0, 8, 5, 0)); builder.addComponent(commentComponent); myComponent = builder.getPanel(); }