@Override public JComponent createComponent() { if (myMainComponent == null) { myMainComponent = new JPanel(new BorderLayout()); myCbUseSoftWrapsAtConsole = new JCheckBox(ApplicationBundle.message("checkbox.use.soft.wraps.at.console"), false); myCommandsHistoryLimitField = new JTextField(3); myCbOverrideConsoleCycleBufferSize = new JCheckBox( ApplicationBundle.message( "checkbox.override.console.cycle.buffer.size", String.valueOf(ConsoleBuffer.getLegacyCycleBufferSize() / 1024)), false); myCbOverrideConsoleCycleBufferSize.addChangeListener( new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { myConsoleCycleBufferSizeField.setEnabled( myCbOverrideConsoleCycleBufferSize.isSelected()); } }); myConsoleCycleBufferSizeField = new JTextField(3); 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()); northPanel.add( new JLabel(ApplicationBundle.message("editbox.console.history.limit")), gridBag.nextLine().next()); northPanel.add(myCommandsHistoryLimitField, gridBag.next()); if (ConsoleBuffer.useCycleBuffer()) { northPanel.add(myCbOverrideConsoleCycleBufferSize, gridBag.nextLine().next()); northPanel.add(myConsoleCycleBufferSizeField, gridBag.next()); } 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( "Fold console lines that contain", "Enter a substring of a console line you'd like to see folded:"); myNegativePanel = new MyAddDeleteListPanel( "Exceptions", "Enter a substring of a console line you don't want to fold:"); splitter.setFirstComponent(myPositivePanel); splitter.setSecondComponent(myNegativePanel); myPositivePanel.getEmptyText().setText("Fold nothing"); myNegativePanel.getEmptyText().setText("No exceptions"); } return myMainComponent; }
public JComponent createComponent() { if (myMainComponent == null) { myMainComponent = new JPanel(new BorderLayout()); Splitter splitter = new Splitter(true); myMainComponent.add(splitter); myPositivePanel = new MyAddDeleteListPanel( "Fold console lines that contain", "Enter a substring of a console line you'd like to see folded:"); myNegativePanel = new MyAddDeleteListPanel( "Exceptions", "Enter a substring of a console line you don't want to fold:"); splitter.setFirstComponent(myPositivePanel); splitter.setSecondComponent(myNegativePanel); myPositivePanel.getEmptyText().setText("Fold nothing"); myNegativePanel.getEmptyText().setText("No exceptions"); } return myMainComponent; }