Disposable (final JTree tree, String actionName) { final DoubleClickListener listener = new DoubleClickListener() { @Override protected boolean onDoubleClick(@NotNull MouseEvent e) { if (tree.getPathForLocation(e.getX(), e.getY()) == null) return false; DataContext dataContext = DataManager.getInstance().getDataContext(tree); GotoFrameSourceAction.doAction(dataContext); return true; } }; listener.installOn(tree); Disposable disposable = () -> listener.uninstall(tree); DebuggerUIUtil.registerActionOnComponent(actionName, tree, disposable); return disposable; }