JComponent () { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); JPanel browserPanel = new JPanel(); browserPanel.setLayout(new GridBagLayout()); GridBagConstraints gc = new GridBagConstraints(); gc.insets = JBUI.insets(2); gc.gridwidth = 2; gc.gridheight = 1; gc.gridx = 0; gc.gridy = 0; gc.anchor = GridBagConstraints.WEST; gc.fill = GridBagConstraints.BOTH; gc.weightx = 1; gc.weighty = 1; myRepositoryBrowser = new RepositoryBrowserComponent(SvnVcs.getInstance(myProject)); browserPanel.add(myRepositoryBrowser, gc); if (myDstName != null) { gc.gridy += 1; gc.gridwidth = 1; gc.gridx = 0; gc.fill = GridBagConstraints.NONE; gc.weightx = 0; gc.weighty = 0; JLabel dstLabel = new JLabel(myDstLabel); browserPanel.add(dstLabel, gc); gc.gridx += 1; gc.weightx = 1; gc.fill = GridBagConstraints.HORIZONTAL; myDstText = new JTextField(); myDstText.setText(myDstName); myDstText.selectAll(); browserPanel.add(myDstText, gc); myDstText.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { getOKAction().setEnabled(isOKActionEnabled()); } @Override public void removeUpdate(DocumentEvent e) { getOKAction().setEnabled(isOKActionEnabled()); } @Override public void changedUpdate(DocumentEvent e) { getOKAction().setEnabled(isOKActionEnabled()); } }); dstLabel.setLabelFor(myDstText); gc.gridx = 0; gc.gridy += 1; gc.gridwidth = 2; browserPanel.add(new JSeparator(), gc); } if (myAllowActions) { panel.add(createToolbar(), BorderLayout.NORTH); } panel.add(browserPanel, BorderLayout.CENTER); return panel; }