JComponent () { myMainPanel = new JPanel(new GridBagLayout()); myNameField = new JTextField(); myExtensionField = new JTextField(7); mySplitter = new Splitter(true, myProportion); myAdjustBox = new JCheckBox(IdeBundle.message("checkbox.reformat.according.to.style")); myLiveTemplateBox = new JCheckBox(IdeBundle.message("checkbox.enable.live.templates")); myTemplateEditor = createEditor(null); myFileName = new EditorTextField(createDocument(createFile("", "file name")), myProject, myVelocityFileType); myFileName.setFont(EditorUtil.getEditorFont()); myFileName.setPlaceholder(IdeBundle.message("template.file.name")); myFileName.setShowPlaceholderWhenFocused(true); myDescriptionComponent = new JEditorPane(); myDescriptionComponent.setEditorKit(HTMLEditorKitBuilder.simple()); myDescriptionComponent.setText(EMPTY_HTML); myDescriptionComponent.setEditable(false); myDescriptionComponent.addHyperlinkListener(new BrowserHyperlinkListener()); myTopPanel = new JPanel(new GridBagLayout()); myTopPanel.setBorder(JBUI.Borders.emptyBottom(3)); JPanel descriptionPanel = new JPanel(new GridBagLayout()); descriptionPanel.add(new JLabel(IdeBundle.message("label.description")), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, JBUI.insetsBottom(2), 0, 0)); descriptionPanel.add(ScrollPaneFactory.createScrollPane(myDescriptionComponent), new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, JBUI.insetsTop(2), 0, 0)); myMainPanel.add(myTopPanel, new GridBagConstraints(0, 0, 4, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, JBInsets.emptyInsets(), 0, 0)); myMainPanel.add(mySplitter, new GridBagConstraints(0, 2, 4, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, JBInsets.emptyInsets(), 0, 0)); mySplitter.setSecondComponent(descriptionPanel); updateTopPanel(false); myNameField.addFocusListener(new FocusAdapter() { @Override public void focusLost(@NotNull FocusEvent e) { onNameChanged(); } }); myExtensionField.addFocusListener(new FocusAdapter() { @Override public void focusLost(@NotNull FocusEvent e) { onNameChanged(); } }); myMainPanel.setPreferredSize(JBUI.size(400, 300)); return myMainPanel; }