Register a ProjectOpenedHook

View: New views
5 Messages — Rating Filter:   Alert me  

Register a ProjectOpenedHook

by Laurent Forêt-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everybody,

I have a very similar problem than the one found here : http://archive.netbsd.se/?ml=netbeans-openide-dev&a=2006-12&m=2876227

Indeed, I would like to listen to all opened AntBasedProjectType in order to add to them an AuxiliaryConfiguration. I think I should use a ProjectOpenedHook and the Project.getLookUp() . But how can I get the project instance ?

Like he did in the linked post, add a Listener to OpenProjects ?

Any help would be very appreciated.
Best regards.

Laurent.




Re: Register a ProjectOpenedHook

by Vadiraj Deshpande :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think this would help : http://blogs.sun.com/scblog/entry/monitoring_opening_and_closing_og

-Vadiraj



On Sat, May 10, 2008 at 12:22 PM, Laurent Forêt <laurent.foret@...> wrote:
Hi everybody,

I have a very similar problem than the one found here : http://archive.netbsd.se/?ml=netbeans-openide-dev&a=2006-12&m=2876227

Indeed, I would like to listen to all opened AntBasedProjectType in order to add to them an AuxiliaryConfiguration. I think I should use a ProjectOpenedHook and the Project.getLookUp() . But how can I get the project instance ?

Like he did in the linked post, add a Listener to OpenProjects ?

Any help would be very appreciated.
Best regards.

Laurent.





Re: Register a ProjectOpenedHook

by mkleint-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Laurent Forêt wrote:

> Hi everybody,
>
> I have a very similar problem than the one found here :
> http://archive.netbsd.se/?ml=netbeans-openide-dev&a=2006-12&m=2876227 
> <http://archive.netbsd.se/?ml=netbeans-openide-dev&a=2006-12&m=2876227>
>
> Indeed, I would like to listen to all opened AntBasedProjectType in
> order to add to them an AuxiliaryConfiguration. I think I should use a
> ProjectOpenedHook and the Project.getLookUp() . But how can I get the
> project instance ?
>
> Like he did in the linked post, add a Listener to OpenProjects ?
>

the OpenProjects listener is one approach.
Alternatively you can create a org.netbeans.spi.project.LookupProvider
instance and register it with the project types you are interested in.  
Then add a ProjectOpenedHook in the lookup returned by your LookupProvider.

Milos

> Any help would be very appreciated.
> Best regards.
>
> Laurent.
>
>
>


Re: Register a ProjectOpenedHook

by Laurent Forêt-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, May 10, 2008 at 10:16 PM, mkleint <Milos.Kleint@...> wrote:
Laurent Forêt wrote:
Hi everybody,

I have a very similar problem than the one found here : http://archive.netbsd.se/?ml=netbeans-openide-dev&a=2006-12&m=2876227 <http://archive.netbsd.se/?ml=netbeans-openide-dev&a=2006-12&m=2876227>


Indeed, I would like to listen to all opened AntBasedProjectType in order to add to them an AuxiliaryConfiguration. I think I should use a ProjectOpenedHook and the Project.getLookUp() . But how can I get the project instance ?

Like he did in the linked post, add a Listener to OpenProjects ?


the OpenProjects listener is one approach.
Alternatively you can create a org.netbeans.spi.project.LookupProvider instance and register it with the project types you are interested in.  Then add a ProjectOpenedHook in the lookup returned by your LookupProvider.

Milos

Hi Milos, thanks again for your answer.

What do you means by register ? Adding a file node in the layer.xml file ?
I try something like that :
<folder name="Projects">
        <folder name="org-netbeans-modules-java-j2seproject">
            <folder name="Lookup">
                <file name="com-...-MyLookupProvider.instance"/>
            </folder>
        </folder>
    </folder>

the build answers me that my module was not a friend of  the j2se module.


C:\Program Files\NetBeans 6.1\harness\build.xml:97: The module com.googlecode.ivybeans.classpath is not a friend of C:\Program Files\NetBeans 6.1\java2\modules\org-netbeans-modules-java-j2seproject.jar
 
I missed something ? I jsut woant to be a friend with that module ;) !


Best regards.

Laurent.
 


Any help would be very appreciated.
Best regards.

Laurent.






Re: Register a ProjectOpenedHook

by Laurent Forêt-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

How stupid I am ;) ! JSEProject is not my friend because I included it in my libraries and not because I add it in my layer .

Laurent.

On Sun, May 11, 2008 at 8:40 AM, Laurent Forêt <laurent.foret@...> wrote:
On Sat, May 10, 2008 at 10:16 PM, mkleint <Milos.Kleint@...> wrote:
Laurent Forêt wrote:
Hi everybody,

I have a very similar problem than the one found here : http://archive.netbsd.se/?ml=netbeans-openide-dev&a=2006-12&m=2876227 <http://archive.netbsd.se/?ml=netbeans-openide-dev&a=2006-12&m=2876227>


Indeed, I would like to listen to all opened AntBasedProjectType in order to add to them an AuxiliaryConfiguration. I think I should use a ProjectOpenedHook and the Project.getLookUp() . But how can I get the project instance ?

Like he did in the linked post, add a Listener to OpenProjects ?


the OpenProjects listener is one approach.
Alternatively you can create a org.netbeans.spi.project.LookupProvider instance and register it with the project types you are interested in.  Then add a ProjectOpenedHook in the lookup returned by your LookupProvider.

Milos

Hi Milos, thanks again for your answer.

What do you means by register ? Adding a file node in the layer.xml file ?
I try something like that :
<folder name="Projects">
        <folder name="org-netbeans-modules-java-j2seproject">
            <folder name="Lookup">
                <file name="com-...-MyLookupProvider.instance"/>
            </folder>
        </folder>
    </folder>

the build answers me that my module was not a friend of  the j2se module.


C:\Program Files\NetBeans 6.1\harness\build.xml:97: The module com.googlecode.ivybeans.classpath is not a friend of C:\Program Files\NetBeans 6.1\java2\modules\org-netbeans-modules-java-j2seproject.jar
 
I missed something ? I jsut woant to be a friend with that module ;) !


Best regards.

Laurent.
 


Any help would be very appreciated.
Best regards.

Laurent.






LightInTheBox - Buy quality products at wholesale price