public ProjectCreateModeStep(final String defaultPath, final WizardContext wizardContext) { final StringBuilder buf = new StringBuilder(); for (WizardMode mode : Extensions.getExtensions(WizardMode.MODES)) { if (mode.isAvailable(wizardContext)) { myModes.add(mode); if (defaultPath != null && wizardContext.isCreatingNewProject()) { if (mode instanceof CreateFromSourcesMode) { myMode = mode; } } else if (mode instanceof CreateFromScratchMode) { myMode = mode; } } final String footnote = mode.getFootnote(wizardContext); if (footnote != null) { if (buf.length() > 0) buf.append("<br>"); buf.append(footnote); } } if (myMode == null) { myMode = myModes.get(0); } myWizardContext = wizardContext; myWholePanel = new JPanel(new GridBagLayout()); myWholePanel.setBorder(BorderFactory.createEtchedBorder()); final Insets insets = new Insets(0, 0, 0, 5); GridBagConstraints gc = new GridBagConstraints( 0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, insets, 0, 0); final ButtonGroup group = new ButtonGroup(); for (final WizardMode mode : myModes) { insets.top = 15; insets.left = 5; final JRadioButton rb = new JRadioButton(mode.getDisplayName(wizardContext), mode == myMode); rb.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD)); rb.addActionListener( new ActionListener() { public void actionPerformed(final ActionEvent e) { setMode(mode); } }); rb.addMouseListener( new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) { wizardContext.requestNextStep(); } } }); myWholePanel.add(rb, gc); group.add(rb); insets.top = 5; insets.left = 20; final JLabel description = new JLabel(mode.getDescription(wizardContext)); myWholePanel.add(description, gc); final JComponent settings = mode.getAdditionalSettings(wizardContext); if (settings != null) { myWholePanel.add(settings, gc); } } myMode.onChosen(true); gc.weighty = 1; gc.fill = GridBagConstraints.BOTH; myWholePanel.add(Box.createVerticalBox(), gc); final JLabel note = new JLabel( "<html>" + buf.toString() + "</html>", IconLoader.getIcon("/nodes/warningIntroduction.png"), SwingConstants.LEFT); note.setVisible(buf.length() > 0); gc.weighty = 0; gc.fill = GridBagConstraints.HORIZONTAL; gc.insets.bottom = 5; myWholePanel.add(note, gc); }