Here can you see, how I did this: https://github.com/Chris2011/gitlogbeans/blob/main/src/main/java/io/github/chris2011/netbeans/plugins/gitlogbeans/PathUtils.java the code is a copy of Markiewbs git branch in status bar plugin.
Cheers CHris Von: Jaroslav Tulach Gesendet: Mittwoch, 27. Oktober 2021 07:22 An: [email protected] Betreff: Re: can't lookup current project What do you mean by current project? There is https://bits.netbeans.org/12.5/javadoc/org-netbeans-modules-projectuiapi-base/ org/netbeans/api/project/ui/OpenProjects.html#getOpenProjects-- or there is https://bits.netbeans.org/12.5/javadoc/org-netbeans-modules-projectapi/org/ netbeans/api/project/ProjectManager.html#findProject- org.openide.filesystems.FileObject- -jt > Hi All > > These give me null: > > Lookup lookup = Utilities.actionsGlobalContext(); > Project project = lookup.lookup(Project.class); > > This also null: > > OpenProjects.getDefault().getMainProject() > > How can I find the current selected project? thanks > > > Thanks > > From Peter (System Architect, Quantr Limited https://www.quantr.hk , Mobile > : 96554595) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
