JComponent () { if (myComponent != null) { return myComponent; } mySplitter = createSplitter(); mySplitter.setSplitterProportionKey(getSplitterProportionKey()); mySplitter.setFirstComponent(myEditor.getComponent()); mySplitter.setSecondComponent(myPreview.getComponent()); mySplitter.setDividerWidth(ExperimentalUI.isNewUI() ? 1 : 2); // We're using OnePixelSplitter, but it actually supports wider dividers. mySplitter.getDivider().setBackground(JBColor.lazy(() -> Objects.requireNonNullElse(EditorColorsManager.getInstance().getGlobalScheme().getColor(EditorColors.PREVIEW_BORDER_COLOR), UIUtil.getPanelBackground()))); myToolbarWrapper = createSplitEditorToolbar(mySplitter); if (myLayout == null) { String lastUsed = PropertiesComponent.getInstance().getValue(getLayoutPropertyName()); myLayout = Layout.fromId(lastUsed, myDefaultLayout); } adjustEditorsVisibility(); BorderLayoutPanel panel = JBUI.Panels.simplePanel(mySplitter).addToTop(myToolbarWrapper); if (!isShowFloatingToolbar()) { myComponent = panel; return myComponent; } myToolbarWrapper.setVisible(false); MyEditorLayeredComponentWrapper layeredPane = new MyEditorLayeredComponentWrapper(panel); myComponent = layeredPane; ActionGroup toolbarGroup = myToolbarWrapper.getRightToolbar().getActionGroup(); LayoutActionsFloatingToolbar toolbar = new LayoutActionsFloatingToolbar(myComponent, toolbarGroup, this); layeredPane.add(panel, JLayeredPane.DEFAULT_LAYER); myComponent.add(toolbar, JLayeredPane.POPUP_LAYER); registerToolbarListeners(panel, toolbar); return myComponent; }