private void updateTopPanel(boolean internalTemplate) {
    myTopPanel.removeAll();
    if (!internalTemplate) {
      boolean child = myTemplate != null && FileTemplateBase.isChild(myTemplate);
      if (!child) {
        JLabel label = new JLabel(IdeBundle.message("label.name"));
        label.setLabelFor(myNameField);
        myTopPanel.add(label,
                       new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
                                              GridBagConstraints.NONE, JBInsets.emptyInsets(), 0, 0));
        myTopPanel.add(myNameField,
                       new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER,
                                              GridBagConstraints.HORIZONTAL, JBUI.insets(0, 3), 0, 0));
      }
      JLabel extLabel = new JLabel(IdeBundle.message("label.extension"));
      extLabel.setLabelFor(myExtensionField);
      myTopPanel.add(extLabel,
                     new GridBagConstraints(child ? 0 : 2, child ? 1 : 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                                            GridBagConstraints.NONE, JBInsets.emptyInsets(), 0, 0));
      myTopPanel.add(myExtensionField,
                     new GridBagConstraints(child ? 1 : 3, child ? 1 : 0, 1, 1, .3, 0.0, GridBagConstraints.WEST,
                                            child ? GridBagConstraints.NONE : GridBagConstraints.HORIZONTAL, JBUI.insetsLeft(3), 0, 0));
      if (child || (isEditable() || StringUtil.isNotEmpty(myFileName.getText()))) {
        JLabel label = new JLabel(IdeBundle.message("label.generate.file.name"));
        label.setLabelFor(myFileName);
        myTopPanel.add(label,
                       new GridBagConstraints(0, child ? 0 : 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
                                              GridBagConstraints.NONE, JBInsets.emptyInsets(), 0, 0));
        myTopPanel.add(myFileName,
                       new GridBagConstraints(1, child ? 0 : 1, 3, 1, 1.0, 0.0, GridBagConstraints.CENTER,
                                              GridBagConstraints.HORIZONTAL, JBUI.insetsLeft(3), 0, 0));
      }
    }
    myMainPanel.revalidate();
    myTopPanel.repaint();
  }
private void updateTopPanel(boolean internalTemplate)