Quantcast

how to get selected file in netbeans project

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to get selected file in netbeans project

chimomura
hello everybody
I am not good in English but I'll try to do my best to express my issue so that you will understand my problem and tell me if you can and i will appreciate it very much.

so, I am developing a netbeans plugin using Netbeans API.
and I need to get the selected file of the main project in File view.

I already get the Main project by this code :
OpenProjects op=OpenProjects.getDefault();
Project prj=op.getMainProject();

but I don't now how to get the selected file (.java, .xml or, any extension )inside this Main Project using netbeans API or other API.

please, if you can help me, I will very appreciate it.

thanks




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to get selected file in netbeans project

chimomura
Hi

I don't Know if my question was not clear but I can give more details
I am working on a project to develope a Netbeans Plugin using netbeans module
so, in my program  I need to get the path of the selected file of the main project in netbeans project  view (the project navigation treeon netbeans IDE).

so, I have already get the main Project using the code I have post the last one but i can't get the selected file in the current main projet  to manipulate it.
I searched in netbeans API but i did not find th class to do it.

I hope i made it clear now

if someone have worked with this API and can help me i will apreciate it

thanks




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get selected file in netbeans project

Mark Wade

On Sep 30, 2010, at 4:59 AM, chimomura wrote:

> Hi
>
> I don't Know if my question was not clear but I can give more details
> I am working on a project to develope a Netbeans Plugin using  
> netbeans module
> so, in my program  I need to get the path of the selected file of  
> the main project in netbeans project  view (the project navigation  
> treeon netbeans IDE).
>
> so, I have already get the main Project using the code I have post  
> the last one but i can't get the selected file in the current main  
> projet  to manipulate it.
> I searched in netbeans API but i did not find th class to do it.
>
> I hope i made it clear now
>
> if someone have worked with this API and can help me i will  
> apreciate it
>
> thanks
>


As you haven't received any responses I thought I might try to offer  
some help, though I don't know the answer.

If I were to try I would look into the Explorer and Property Sheet  
API, specifically  
org.openide.explorer.view.NodeListModel.getSelectedItem().
Also org.netbeans.spi.viewmodel for events and listeners.


Mark Wade
[hidden email]



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to get selected file in netbeans project

Mark Wade

On Oct 1, 2010, at 10:15 AM, Mark Wade wrote:

> As you haven't received any responses I thought I might try to offer  
> some help, though I don't know the answer.
>
> If I were to try I would look into the Explorer and Property Sheet  
> API, specifically  
> org.openide.explorer.view.NodeListModel.getSelectedItem().
> Also org.netbeans.spi.viewmodel for events and listeners.

Yeah, that's not any help.  Maybe you'd have a better response on the  
developer forum.

http://forums.netbeans.org/netbeans-developers.html

and the mailing list archives:

http://netbeans.org/projects/platform/lists/dev/archive

subscribe to the mailing list here:

http://netbeans.org/community/lists/top.html#dev

Mark Wade
[hidden email]



Loading...