# How to add "Open In Find Tool Window" to reference navigation targets popup?

**URL:** <https://platform.jetbrains.com/t/how-to-add-open-in-find-tool-window-to-reference-navigation-targets-popup/655>\
**Category:** IntelliJ Platform\
**Created:** [February 21, 2025, 2:08pm UTC](https://platform.jetbrains.com/t/how-to-add-open-in-find-tool-window-to-reference-navigation-targets-popup/655 "2025-02-21T14:08:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bohdan.harniuk](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/bohdan.harniuk/32/147_2.png) [@bohdan.harniuk](https://platform.jetbrains.com/u/bohdan.harniuk)\
**Post date:** [February 21, 2025, 2:08pm UTC](https://platform.jetbrains.com/t/how-to-add-open-in-find-tool-window-to-reference-navigation-targets-popup/655/1 "2025-02-21T14:08:55Z")

</div>

I am adding reference navigation using a reference navigation contributor, where I register my reference providers for framework-specific elements via the component registrar. Here are some examples:

**Registration:**

```auto
<psi.referenceContributor language="XML" implementation="XXXReferenceContributor"/>

```

**Contributor:**

```auto
...
class XXXReferenceContributor : PsiReferenceContributor() {

    override fun registerReferenceProviders(registrar: PsiReferenceRegistrar) {
        // <block name="XXX">
        registrar.registerReferenceProvider(
            XmlPatterns.xmlAttributeValue(
                XmlPatterns.xmlAttribute("name").withParent(
                    XmlPatterns.xmlTag().withName("block")
                )
            ).inFile(
                PlatformPatterns.psiFile(XmlFile::class.java)
            ),
            LayoutBlockReferencesProvider()
        )
    }
}

```

**Provider:**

```auto
...
class LayoutBlockReferencesProvider : PsiReferenceProvider() {

    override fun getReferencesByElement(element: PsiElement, context: ProcessingContext): Array<PsiReference> {
       ...

        return references.toTypedArray()
    }
}

```

**Problem:**

In some cases, I have more than 20 navigation targets. I want to add an **“Open in Find Tool Window”** button to the navigation popup that displays the target results. However, I am unable to find where and how to implement this functionality.

### My Current Popup:

 ![Screenshot 2025-02-21 at 15.52.16](https://us1.discourse-cdn.com/flex001/uploads/jetbrains_platform/original/1X/86a6473b1115577d77ed5dccedbfcefa818d8ce5.png)

---

<div class="post-metadata">

**Author:** ![yann.cebron](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/yann.cebron/32/15_2.png) [@yann.cebron](https://platform.jetbrains.com/u/yann.cebron)\
**Post date:** [February 24, 2025, 10:10am UTC](https://platform.jetbrains.com/t/how-to-add-open-in-find-tool-window-to-reference-navigation-targets-popup/655/2 "2025-02-24T10:10:31Z")

</div>

_Choose Declaration_ is a platform specific feature when you resolve to multiple targets. This dialog cannot be modified, but you can file RFE [https://youtrack.jetbrains.com/issues/IJPL](https://youtrack.jetbrains.com/issues/IJPL)

---

<div class="post-metadata">

**Author:** ![bohdan.harniuk](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/bohdan.harniuk/32/147_2.png) [@bohdan.harniuk](https://platform.jetbrains.com/u/bohdan.harniuk)\
**Post date:** [February 24, 2025, 10:29am UTC](https://platform.jetbrains.com/t/how-to-add-open-in-find-tool-window-to-reference-navigation-targets-popup/655/4 "2025-02-24T10:29:46Z")

</div>

Thank you! I was wondering whether it is possible to somehow adjust that popup. It is still not such a critical enhancement in my case. Thanks for your answer!

---

<div class="post-metadata">

**Author:** ![xepozz](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/xepozz/32/589_2.png) [@xepozz](https://platform.jetbrains.com/u/xepozz)\
**Post date:** [February 24, 2025, 2:27pm UTC](https://platform.jetbrains.com/t/how-to-add-open-in-find-tool-window-to-reference-navigation-targets-popup/655/5 "2025-02-24T14:27:08Z")

</div>

Usually there are few targets to reference.  
Maybe you were looking for opening a search window to find “usages”?

Btw, you may change presentation layour of your references to make these “default.xml” readable with tail text, navigation file and offset, icon and the rest stuff.

---

<div class="post-metadata">

**Author:** ![bohdan.harniuk](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/bohdan.harniuk/32/147_2.png) [@bohdan.harniuk](https://platform.jetbrains.com/u/bohdan.harniuk)\
**Post date:** [February 24, 2025, 2:45pm UTC](https://platform.jetbrains.com/t/how-to-add-open-in-find-tool-window-to-reference-navigation-targets-popup/655/6 "2025-02-24T14:45:25Z")

</div>

@xepozz , thank you for your response!

No, these targets are populated by a custom reference provider. It can contain a huge number of results (sometimes).

Yes, I know about target navigable customizations; I have already implemented them. I just wanted to be able to open the result in a tool window. This logic is encapsulated in the `GotoTargetHandler`, here:

```auto
setCouldPin(popup1 -> {
        usageView.set(FindUtil.showInUsageView(gotoData.source, gotoData.targets,
                                               getFindUsagesTitle(gotoData.source, name, gotoData.targets.length),
                                               gotoData.source.getProject()));
        popup1.cancel();
        return false;
      }).

```

Not a big deal that it cannot be achieved in this context.
