Re: How to open Navigator panel programmatically?
Peter Nabbefeld <[email protected]> Sat, 15 Jul 2017 00:22:04 +0200
| Newsgroups | gmane.comp.java.netbeans.modules.openide.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Arsi,
thank You - that works great!
Kind regards
Peter
Am 14.07.2017 um 23:43 schrieb arsi:
> Hello,
>
> Simple way:
>
> |ClassLoader loader = Lookup.getDefault().lookup(ClassLoader.class); try
> { Class<?> navigatorTC =
> loader.loadClass("org.netbeans.modules.navigator.NavigatorTC"); Method m
> = navigatorTC.getDeclaredMethod("getInstance"); TopComponent navPanel =
> (TopComponent) m.invoke(null); navPanel.open();
> navPanel.requestActive(); } catch (Exception ex) {
> Exceptions.printStackTrace(ex); } |
>
>
>
> or:
>
> |NavigatorTC navTC = NavigatorTC.getInstance(); navTC.open();
> navTC.requestActive(); |
>
>
>
> It's a module private package..
>
> For nb module:
>
> add module *org-netbeans-spi-navigator*, then edit and set it as
> implementation version..
>
>
>
>
> For maven:
>
> |<plugin> <artifactId>nbm-maven-plugin</artifactId>
> <groupId>org.codehaus.mojo</groupId> <extensions>true</extensions>
> <configuration> <moduleDependencies> <dependency> <!--Private Package
> Reference--> <id>org.netbeans.api:org-netbeans-spi-navigator</id>
> <type>impl</type> </dependency> </moduleDependencies> </configuration>
> </plugin> |
>
>
> Arsi
> ------------------------------------------------------------------------
>
> *From:* Peter Nabbefeld
> *Sent:* Friday, July 14, 2017 10:19PM
> *To:* Dev
> *Subject:* [platform-dev] How to open Navigator panel programmatically?
>
>
>>
>> Hello,
>>
>> I wonder how to activate navigator panel programmatically. My current
>> code is:
>