JComponent () { if (myMainComponent == null) { myMainComponent = new JPanel(new BorderLayout()); myCbUseSoftWrapsAtConsole = new JCheckBox(ApplicationBundle.message("checkbox.use.soft.wraps.at.console"), false); myCommandsHistoryLimitField = new JTextField(4); myCbOverrideConsoleCycleBufferSize = new JCheckBox(ApplicationBundle.message("checkbox.override.console.cycle.buffer.size", String.valueOf(ConsoleBuffer.getLegacyCycleBufferSize() / 1024)), false); myCbOverrideConsoleCycleBufferSize.addChangeListener(e -> { myConsoleCycleBufferSizeField.setEnabled(myCbOverrideConsoleCycleBufferSize.isSelected()); myConsoleBufferSizeWarningLabel.setVisible(myCbOverrideConsoleCycleBufferSize.isSelected()); }); myConsoleCycleBufferSizeField = new JTextField(4); myConsoleBufferSizeWarningLabel = new JLabel(); myConsoleBufferSizeWarningLabel.setForeground(JBColor.red); myConsoleCycleBufferSizeField.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(@NotNull DocumentEvent e) { updateWarningLabel(); } }); myEncodingComboBox = new ConsoleEncodingComboBox(); JPanel northPanel = new JPanel(new GridBagLayout()); GridBag gridBag = new GridBag(); gridBag.anchor(GridBagConstraints.WEST).setDefaultAnchor(GridBagConstraints.WEST); northPanel.add(myCbUseSoftWrapsAtConsole, gridBag.nextLine().next()); northPanel.add(Box.createHorizontalGlue(), gridBag.next().coverLine()); JLabel label = new JLabel(ApplicationBundle.message("editbox.console.history.limit")); label.setLabelFor(myCommandsHistoryLimitField); northPanel.add(label, gridBag.nextLine().next()); northPanel.add(myCommandsHistoryLimitField, gridBag.next()); if (ConsoleBuffer.useCycleBuffer()) { northPanel.add(myCbOverrideConsoleCycleBufferSize, gridBag.nextLine().next()); northPanel.add(myConsoleCycleBufferSizeField, gridBag.next()); northPanel.add(new JLabel(ExecutionBundle.message("settings.console.kb")), gridBag.next()); northPanel.add(Box.createHorizontalStrut(JBUIScale.scale(20)), gridBag.next()); northPanel.add(myConsoleBufferSizeWarningLabel, gridBag.next()); } northPanel.add(new JLabel(ApplicationBundle.message("combobox.console.default.encoding.label")), gridBag.nextLine().next()); northPanel.add(myEncodingComboBox,gridBag.next().coverLine()); if (!editFoldingsOnly()) { JPanel wrapper = new JPanel(new BorderLayout()); wrapper.add(northPanel, BorderLayout.WEST); myMainComponent.add(wrapper, BorderLayout.NORTH); } Splitter splitter = new Splitter(true); myMainComponent.add(splitter, BorderLayout.CENTER); myPositivePanel = new MyAddDeleteListPanel(ApplicationBundle.message("console.fold.console.lines"), ApplicationBundle.message("console.enter.substring.folded")); myNegativePanel = new MyAddDeleteListPanel(ApplicationBundle.message("console.fold.exceptions"), ApplicationBundle.message("console.enter.substring.dont.fold")); splitter.setFirstComponent(myPositivePanel); splitter.setSecondComponent(myNegativePanel); myPositivePanel.getEmptyText().setText(ApplicationBundle.message("console.fold.nothing")); myNegativePanel.getEmptyText().setText(ApplicationBundle.message("console.no.exceptions")); } return myMainComponent; }