JPanel () { createModel(); myTree = new MyTree(); myTree.setRootVisible(false); myTree.setShowsRootHandles(true); myTree.updateUI(); myTree.setLargeModel(true); myTree.addMouseListener(new PopupHandler() { @Override public void invokePopup(Component comp, int x, int y) { popupInvoked(comp, x, y); } }); EditSourceOnDoubleClickHandler.install(myTree); EditSourceOnEnterKeyHandler.install(myTree); myAutoScrollToSourceHandler.install(myTree); myOccurenceNavigatorSupport = new OccurenceNavigatorSupport(myTree) { @Override protected Navigatable createDescriptorForNode(@NotNull DefaultMutableTreeNode node) { if (!(node instanceof MessageNode messageNode)) { return null; } AntBuildMessageView.MessageType type = messageNode.getType(); if (type != AntBuildMessageView.MessageType.MESSAGE && type != AntBuildMessageView.MessageType.ERROR) { return null; } if (!isValid(messageNode.getFile())) { return null; } return PsiNavigationSupport.getInstance() .createNavigatable(myProject, messageNode.getFile(), messageNode.getOffset()); } @NotNull @Override public String getNextOccurenceActionName() { return AntBundle.message("ant.execution.next.error.warning.action.name"); } @NotNull @Override public String getPreviousOccurenceActionName() { return AntBundle.message("ant.execution.previous.error.warning.action.name"); } }; final JScrollPane treePane = MessageTreeRenderer.install(myTree); if (myBuildFile instanceof AntBuildFileBase) { ((MessageTreeRenderer)myTree.getCellRenderer()).setUseAnsiColor( ((AntBuildFileBase)myBuildFile).isColoredOutputMessages() ); } return JBUI.Panels.simplePanel(treePane); }