void () { myTree.setShowsRootHandles(true); myTree.setRootVisible(false); myTree.setRowHeight(0); // enable variable-height rows myTree.setCellRenderer(new TodoCompositeRenderer()); EditSourceOnDoubleClickHandler.install(myTree); EditSourceOnEnterKeyHandler.install(myTree); TreeUIHelper.getInstance().installTreeSpeedSearch(myTree); DefaultActionGroup group = new DefaultActionGroup(); group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE)); group.addSeparator(); group.add(CommonActionsManager.getInstance().createExpandAllAction(myTreeExpander, this)); group.add(CommonActionsManager.getInstance().createCollapseAllAction(myTreeExpander, this)); group.addSeparator(); group.add(ActionManager.getInstance().getAction(IdeActions.GROUP_VERSION_CONTROLS)); PopupHandler.installPopupMenu(myTree, group, ActionPlaces.TODO_VIEW_POPUP); myUsagePreviewPanel.setVisible(mySettings.showPreview); setContent(createCenterComponent()); myTree.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(@NotNull TreeSelectionEvent e) { myCoroutineHelper.schedulePreviewPanelLayoutUpdate(); } }); myAutoScrollToSourceHandler = new MyAutoScrollToSourceHandler(); myAutoScrollToSourceHandler.install(myTree); // Create tool bars and register custom shortcuts DefaultActionGroup toolbarGroup = new DefaultActionGroup(); toolbarGroup.add(new PreviousOccurenceToolbarAction(myOccurenceNavigator)); toolbarGroup.add(new NextOccurenceToolbarAction(myOccurenceNavigator)); toolbarGroup.add(new SetTodoFilterAction(myProject, mySettings, todoFilter -> setTodoFilter(todoFilter))); toolbarGroup.add(createAutoScrollToSourceAction()); toolbarGroup.add(CommonActionsManager.getInstance().createExpandAllAction(myTreeExpander, this)); toolbarGroup.add(CommonActionsManager.getInstance().createCollapseAllAction(myTreeExpander, this)); if (!myCurrentFileMode) { DefaultActionGroup groupBy = createGroupByActionGroup(); toolbarGroup.add(groupBy); } toolbarGroup.add(new MyPreviewAction()); ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.TODO_VIEW_TOOLBAR, toolbarGroup, false); toolbar.setTargetComponent(myTree); setToolbar(toolbar.getComponent()); }