JComponent () { String panelConstraints = "flowy, ins 0 0 0 10, fill"; MigLayout migLayout = new MigLayout(panelConstraints); JPanel contentPane = new JPanel(migLayout); myPullCheckBox = new JBCheckBox(HgBundle.message("action.hg4idea.pull.p"), true); myPullCheckBox.setToolTipText(HgBundle.message("action.hg4idea.pull.from.default.remote")); myPullCheckBox.setSelected(true); myOnlyUpdateButton = new JRadioButton(HgBundle.message("action.hg4idea.pull.only.update"), true); myOnlyUpdateButton.setToolTipText(HgBundle.message("action.hg4idea.pull.update.to.head")); myMergeRadioButton = new JRadioButton(HgBundle.message("action.hg4idea.pull.update.merge"), false); myMergeRadioButton.setToolTipText(HgBundle.message("action.hg4idea.pull.merge.if.in.extra")); myMergeRadioButton.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { updateEnabledStates(); } }); myCommitAfterMergeCheckBox = new JCheckBox(HgBundle.message("action.hg4idea.pull.commit.after.merge"), false); myCommitAfterMergeCheckBox.setToolTipText(HgBundle.message("action.hg4idea.pull.commit.automatically")); myCommitAfterMergeCheckBox.setSelected(false); myRebaseRadioButton = new JRadioButton(HgBundle.message("action.hg4idea.pull.rebase"), false); myRebaseRadioButton.setToolTipText(HgBundle.message("action.hg4idea.pull.rebase.tooltip")); contentPane.add(myPullCheckBox, "left"); JPanel strategyPanel = new JPanel(new MigLayout(panelConstraints)); strategyPanel.setBorder(IdeBorderFactory.createTitledBorder(HgBundle.message("action.hg4idea.pull.update.strategy"), false)); strategyPanel.add(myOnlyUpdateButton, "left"); strategyPanel.add(myMergeRadioButton, "left"); strategyPanel.add(myCommitAfterMergeCheckBox, "gapx 5%"); strategyPanel.add(myRebaseRadioButton, "left"); contentPane.add(strategyPanel); ButtonGroup group = new ButtonGroup(); group.add(myOnlyUpdateButton); group.add(myRebaseRadioButton); group.add(myMergeRadioButton); updateEnabledStates(); return contentPane; }