void () { myComponent = new JPanel(new BorderLayout()); myLog = new JEditorPane(); myLog.setEditorKit(new StyledEditorKit()); myLog.setEditable(false); myState = ApplicationManager.getApplication().getService(PlaybackDebuggerState.class); final DefaultActionGroup controlGroup = new DefaultActionGroup(); controlGroup.add(new RunOnFameActivationAction()); controlGroup.add(new ActivateFrameAndRun()); controlGroup.add(new StopAction()); JPanel north = new JPanel(new BorderLayout()); north.add(ActionManager.getInstance().createActionToolbar("PlaybackDbg", controlGroup, true).getComponent(), BorderLayout.WEST); final JPanel right = new JPanel(new BorderLayout()); right.add(myCurrentScript, BorderLayout.CENTER); myCurrentScript.setText(myState.currentScript); myCurrentScript.setEditable(false); final DefaultActionGroup fsGroup = new DefaultActionGroup(); SaveAction saveAction = new SaveAction(); saveAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("control S")), myComponent); fsGroup.add(saveAction); SetScriptFileAction setScriptFileAction = new SetScriptFileAction(); setScriptFileAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("control O")), myComponent); fsGroup.add(setScriptFileAction); AnAction newScriptAction = new NewScriptAction(); newScriptAction.registerCustomShortcutSet(new CustomShortcutSet(KeyStroke.getKeyStroke("control N")), myComponent); fsGroup.add(newScriptAction); final ActionToolbar tb = ActionManager.getInstance().createActionToolbar("PlaybackDbgExtra", fsGroup, true); tb.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY); right.add(tb.getComponent(), BorderLayout.EAST); north.add(right, BorderLayout.CENTER); myComponent.add(north, BorderLayout.NORTH); myCodeEditor = new JTextArea(); myCodeEditor.getDocument().addDocumentListener(new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { myChanged = true; } @Override public void removeUpdate(DocumentEvent e) { myChanged = true; } @Override public void changedUpdate(DocumentEvent e) { myChanged = true; } }); if (pathToFile() != null) { loadFrom(Objects.requireNonNull(pathToFile())); } final Splitter script2Log = new Splitter(true); script2Log.setFirstComponent(ScrollPaneFactory.createScrollPane(myCodeEditor)); script2Log.setSecondComponent(ScrollPaneFactory.createScrollPane(myLog)); myComponent.add(script2Log, BorderLayout.CENTER); myVfsListener = new VirtualFileListener() { @Override public void contentsChanged(@NotNull VirtualFileEvent event) { final VirtualFile file = pathToFile(); if (file != null && file.equals(event.getFile())) { loadFrom(event.getFile()); } } }; LocalFileSystem.getInstance().addVirtualFileListener(myVfsListener); }