Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How can I get notified when java build path is changed
How can I get notified when java build path is changed [message #332909] Thu, 13 November 2008 16:47 Go to next message
Raymond Mising name is currently offline Raymond Mising nameFriend
Messages: 59
Registered: July 2009
Member
Hey,

My plug-in wants to be notified when the java build path of a project is
changed. How can it get notified? is there any property change listener I
can implement? Thanks.
Re: How can I get notified when java build path is changed [message #332910 is a reply to message #332909] Thu, 13 November 2008 16:54 Go to previous messageGo to next message
Raymond Mising name is currently offline Raymond Mising nameFriend
Messages: 59
Registered: July 2009
Member
To be more specific, if the java build path of a project is changed, I
want to know what the change is (e.g. what jar/project/folder is
added/removed to/from the class path).
Re: How can I get notified when java build path is changed [message #332911 is a reply to message #332910] Thu, 13 November 2008 17:03 Go to previous messageGo to next message
Raymond Mising name is currently offline Raymond Mising nameFriend
Messages: 59
Registered: July 2009
Member
Raymond wrote:

> To be more specific, if the java build path of a project is changed, I
> want to know what the change is (e.g. what jar/project/folder is
> added/removed to/from the class path).

I know a change of java build path invokes a resource change event but
through resource change listener, I can only know the project is changed
but I have no idea what the change is.
Re: How can I get notified when java build path is changed [message #332915 is a reply to message #332911] Thu, 13 November 2008 19:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 11/13/2008 12:03 PM, Raymond wrote:
> Raymond wrote:
>
>> To be more specific, if the java build path of a project is changed, I
>> want to know what the change is (e.g. what jar/project/folder is
>> added/removed to/from the class path).
>
> I know a change of java build path invokes a resource change event but
> through resource change listener, I can only know the project is changed
> but I have no idea what the change is.

I would get the IJavaProject associated with the resource change event
[see org.eclipse.jdt.core.JavaCore.create(IProject)] and then see if you
can inspect its build path through the IJavaProject API.

Does the resource delta include the .classpath file? I'd expect it
would; that way you can distinguish changes that affect build path from
other project changes.

Hope this helps,
Eric
Re: How can I get notified when java build path is changed [message #332917 is a reply to message #332915] Thu, 13 November 2008 20:25 Go to previous messageGo to next message
Raymond Mising name is currently offline Raymond Mising nameFriend
Messages: 59
Registered: July 2009
Member
Eric Rizzo wrote:

> I would get the IJavaProject associated with the resource change event
> [see org.eclipse.jdt.core.JavaCore.create(IProject)] and then see if you
> can inspect its build path through the IJavaProject API.

> Does the resource delta include the .classpath file? I'd expect it
> would; that way you can distinguish changes that affect build path from
> other project changes.

> Hope this helps,
> Eric

Thanks for your reply, Eric.
Implementing a resource change listener is what I do now. The .classpath
file is in the change delta but as what I said, I only know the file is
changed but I don't know what the change is. I need more specific
information. I want to know what is added/removed to/from the java build
path.

Thanks.
Re: How can I get notified when java build path is changed [message #332929 is a reply to message #332917] Fri, 14 November 2008 14:28 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 11/13/2008 3:25 PM, Raymond wrote:
> Eric Rizzo wrote:
>
>> I would get the IJavaProject associated with the resource change event
>> [see org.eclipse.jdt.core.JavaCore.create(IProject)] and then see if
>> you can inspect its build path through the IJavaProject API.
>
>> Does the resource delta include the .classpath file? I'd expect it
>> would; that way you can distinguish changes that affect build path
>> from other project changes.
>
>> Hope this helps,
>> Eric
>
> Thanks for your reply, Eric.
> Implementing a resource change listener is what I do now. The .classpath
> file is in the change delta but as what I said, I only know the file is
> changed but I don't know what the change is. I need more specific
> information. I want to know what is added/removed to/from the java build
> path.

I don't think there is any notification API at that level; that's why I
suggested getting the IJavaProject from the IProject in the delta.

You might have better luck by posting the question to the
eclipse.tools.jdt newsgroup; maybe the JDT gurus there know of an
alternative API that would help.

Eric
Previous Topic:How to sort the preferences pages ?
Next Topic:Help Files Offline
Goto Forum:
  


Current Time: Wed Jul 17 19:49:47 GMT 2024

Powered by FUDForum. Page generated in 0.04545 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top