LinkInfo (@NotNull Project project, @NotNull HyperlinkInfo info) { LinkInfoEx.Builder builder = new LinkInfoEx.Builder().setNavigateCallback(() -> { info.navigate(project); }); if (info instanceof HyperlinkWithPopupMenuInfo) { builder.setPopupMenuGroupProvider(new LinkInfoEx.PopupMenuGroupProvider() { @Override public @NotNull List<TerminalAction> getPopupMenuGroup(@NotNull MouseEvent event) { ActionGroup group = ((HyperlinkWithPopupMenuInfo)info).getPopupMenuGroup(event); AnAction[] actions = group != null ? group.getChildren(null) : AnAction.EMPTY_ARRAY; return ContainerUtil.map(actions, action -> TerminalActionUtil.createTerminalAction(JBTerminalWidget.this, action)); } }); } if (info instanceof HyperlinkWithHoverInfo) { builder.setHoverConsumer(new LinkInfoEx.HoverConsumer() { @Override public void onMouseEntered(@NotNull JComponent hostComponent, @NotNull Rectangle linkBounds) { ((HyperlinkWithHoverInfo)info).onMouseEntered(hostComponent, linkBounds); } @Override public void onMouseExited() { ((HyperlinkWithHoverInfo)info).onMouseExited(); } }); } return builder.build(); }