JComponent () { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); gc.insets = JBUI.insets(2); gc.gridwidth = 1; gc.gridheight = 1; gc.gridx = 0; gc.gridy = 0; gc.anchor = GridBagConstraints.WEST; gc.fill = GridBagConstraints.NONE; gc.weightx = 0; gc.weighty = 0; panel.add(new JBLabel(message("label.import.to")), gc); gc.gridx += 1; gc.gridwidth = 2; gc.weightx = 1; gc.fill = GridBagConstraints.HORIZONTAL; JBLabel urlLabel = new JBLabel(myURL.toDecodedString()); urlLabel.setFont(urlLabel.getFont().deriveFont(Font.BOLD)); panel.add(urlLabel, gc); gc.gridy += 1; gc.gridwidth = 1; gc.gridx = 0; gc.weightx = 0; gc.fill = GridBagConstraints.NONE; panel.add(new JBLabel(message("label.import.from")), gc); gc.gridx += 1; gc.gridwidth = 2; gc.weightx = 1; gc.fill = GridBagConstraints.HORIZONTAL; myPathField = new TextFieldWithBrowseButton(this); myPathField.setText(myFile.getAbsolutePath()); myPathField.setEditable(false); panel.add(myPathField, gc); // other options. gc.gridy += 1; gc.gridx = 0; gc.weightx = 0; gc.gridwidth = 3; gc.fill = GridBagConstraints.NONE; final JBLabel depthLabel = new JBLabel(message("label.depth.text")); depthLabel.setToolTipText(message("label.depth.description")); panel.add(depthLabel, gc); ++gc.gridx; myDepth = new DepthCombo(false); panel.add(myDepth, gc); depthLabel.setLabelFor(myDepth); gc.gridx = 0; gc.gridy += 1; myIncludeIgnoredCheckbox = new JBCheckBox(message("checkbox.include.ignored.resources")); myIncludeIgnoredCheckbox.setSelected(true); panel.add(myIncludeIgnoredCheckbox, gc); gc.gridy += 1; panel.add(new JBLabel(message("label.commit.message")), gc); gc.gridy += 1; gc.gridwidth = 3; gc.gridx = 0; gc.weightx = 1; gc.weighty = 1; gc.anchor = GridBagConstraints.NORTH; gc.fill = GridBagConstraints.BOTH; myCommitMessage = new JTextArea(10, 0); myCommitMessage.setWrapStyleWord(true); myCommitMessage.setLineWrap(true); panel.add(ScrollPaneFactory.createScrollPane(myCommitMessage), gc); gc.gridy += 1; gc.gridwidth = 3; gc.gridx = 0; gc.weightx = 0; gc.weighty = 0; gc.anchor = GridBagConstraints.NORTH; gc.fill = GridBagConstraints.HORIZONTAL; panel.add(new JBLabel(message("label.recent.messages")), gc); gc.gridy += 1; ComboBox<String> messagesBox = configureRecentMessagesComponent(myProject, new ComboBox<>(), message -> { myCommitMessage.setText(message); myCommitMessage.selectAll(); }); panel.add(messagesBox, gc); String lastMessage = VcsConfiguration.getInstance(myProject).getLastNonEmptyCommitMessage(); if (lastMessage != null) { myCommitMessage.setText(lastMessage); myCommitMessage.selectAll(); } return panel; }