Re: [MODULE]Get main project and get its git information

Benno Markiewicz <[email protected]> Thu, 2 Feb 2017 19:32:10 +0100
Newsgroups gmane.comp.java.netbeans.devel
Message-ID <CAA_aP4j+f22TvxN3j6vcgk1PS21USQ6R4G-xkAP2abkyWy6VYg@mail.gmail.com>
I read your mail again. Have a look at my old Plugin
https://github.com/markiewb/nb-git-branch-in-statusbar



Den 2 feb. 2017 19:28 skrev "Benno Markiewicz" <
[email protected]>:

> What do you think is the main project? The main can be set via Run->Set
> Main Project
>
> I guess this info not what you to read. So what is the use case behind
> your question?
>
> Den 2 feb. 2017 14:00 skrev "Gabriele" <[email protected]>:
>
>> I'm using this code to get the selected project, but getMainProject
>> always returns null so it falls back to getting all projects.
>>
>> Code:
>>  Project[] projects;
>>  Project project = OpenProjects.getDefault().getMainProject();
>>  projects = project == null ? OpenProjects.getDefault().getOpenProjects()
>> : new Project[]{project};
>>  for (Project p : projects) {
>>    ProjectInformation info = ProjectUtils.getInformation(p);
>>    System.out.println(info.getName());
>>  }
>>
>>
>>
>> After that, I want to extract the project's credentials and info to
>> connect to the repository. I couldn't find any example or hint on how to do
>> that.
>> Can anyone set me in the right direction?
>>
>>
>>
>>
>>