JPanel () { GridBagConstraints constraint = new GridBagConstraints(); JPanel outer = new JPanel(new GridBagLayout()); // UI Layout - Settings JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.setBorder(IdeBorderFactory.createTitledBorder(JavaBundle.message("generate.tostring.settings"))); Container innerPanel = Box.createHorizontalBox(); innerPanel.add(fullyQualifiedName); innerPanel.add(Box.createHorizontalGlue()); panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(enableMethods); innerPanel.add(Box.createHorizontalGlue()); panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(moveCaretToMethod); innerPanel.add(Box.createHorizontalGlue()); panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(sortElements); sortElements.addActionListener(new OnSortElements()); innerPanel.add(Box.createHorizontalStrut(3)); innerPanel.add(sortElementsComboBox); panel.add(innerPanel); sortElementsComboBox.addItem(JavaBundle.message("generate.tostring.sort.ascending")); sortElementsComboBox.addItem(JavaBundle.message("generate.tostring.sort.descending")); sortElementsComboBox.addItem(JavaBundle.message("generate.tostring.sort.super")); constraint.gridwidth = GridBagConstraints.REMAINDER; constraint.fill = GridBagConstraints.BOTH; constraint.gridx = 0; constraint.gridy = 0; constraint.insets.left = 5; constraint.insets.right = 5; outer.add(panel, constraint); // UI Layout - Conflict Resolution DuplicationPolicy[] options = PolicyOptions.getConflictOptions(); initialValueForReplaceDialog = new JRadioButton[options.length]; ButtonGroup selection = new ButtonGroup(); for (int i = 0; i < options.length; i++) { initialValueForReplaceDialog[i] = new JRadioButton(new ConflictResolutionOptionAction(options[i])); selection.add(initialValueForReplaceDialog[i]); } panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.setBorder(IdeBorderFactory.createTitledBorder(JavaBundle.message("generate.tostring.already.exist.border"))); for (JRadioButton anInitialValueForReplaceDialog : initialValueForReplaceDialog) { panel.add(anInitialValueForReplaceDialog); } constraint.gridx = 0; constraint.gridy = 1; outer.add(panel, constraint); // UI Layout - Insert Position InsertWhere[] options2 = PolicyOptions.getNewMethodOptions(); initialValueForNewMethodDialog = new JRadioButton[options2.length]; ButtonGroup selection2 = new ButtonGroup(); for (int i = 0; i < options2.length; i++) { initialValueForNewMethodDialog[i] = new JRadioButton(new InsertNewMethodOptionAction(options2[i])); selection2.add(initialValueForNewMethodDialog[i]); } panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.setBorder(IdeBorderFactory.createTitledBorder(JavaBundle.message("generate.tostring.insert.border"))); for (JRadioButton anInitialValueForNewMethodDialog : initialValueForNewMethodDialog) { panel.add(anInitialValueForNewMethodDialog); } constraint.gridx = 0; constraint.gridy = 2; outer.add(panel, constraint); // UI Layout - Exclude fields panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.setBorder(IdeBorderFactory.createTitledBorder(CommonBundle.message("button.exclude"))); innerPanel = Box.createHorizontalBox(); innerPanel.add(filterConstant); innerPanel.add(Box.createHorizontalGlue()); panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(filterStatic); innerPanel.add(Box.createHorizontalGlue()); panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(filterTransient); innerPanel.add(Box.createHorizontalGlue()); panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(filterEnum); innerPanel.add(Box.createHorizontalGlue()); panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(filterLoggers); innerPanel.add(Box.createHorizontalGlue()); panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(new JLabel(JavaBundle.message("generate.tostring.exclude.by.field.name"))); innerPanel.add(Box.createHorizontalStrut(3)); innerPanel.add(filterFieldName); filterFieldName.setMinimumSize(JBUI.size(100, 20)); // avoid input field to small panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(new JLabel(JavaBundle.message("generate.tostring.exclude.by.field.type"))); innerPanel.add(Box.createHorizontalStrut(3)); innerPanel.add(filterFieldType); filterFieldType.setMinimumSize(JBUI.size(100, 20)); // avoid input field to small panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(new JLabel(JavaBundle.message("generate.tostring.exclude.by.name"))); innerPanel.add(Box.createHorizontalStrut(3)); innerPanel.add(filterMethodName); filterMethodName.setMinimumSize(JBUI.size(100, 20)); // avoid input field to small panel.add(innerPanel); innerPanel = Box.createHorizontalBox(); innerPanel.add(new JLabel(JavaBundle.message("generate.tostring.exclude.by.return.type"))); innerPanel.add(Box.createHorizontalStrut(3)); innerPanel.add(filterMethodType); filterMethodType.setMinimumSize(JBUI.size(100, 20)); // avoid input field to small panel.add(innerPanel); constraint.gridx = 0; constraint.gridy = 3; outer.add(panel, constraint); return outer; }