Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » forcing a project to refresh after updating an IClasspathContainerPage
forcing a project to refresh after updating an IClasspathContainerPage [message #334055] Fri, 16 January 2009 17:07 Go to next message
Eclipse UserFriend
Originally posted by: brianf.sybase.com

Hi all...

I've created a classpath container so that folks can add driver jars to a
Java project by referencing a DTP Driver Definition. That probably doesn't
mean much to anybody, but the idea is that someone could easily use parts of
DTP to jumpstart some JDBC development in a project...

That said, I have it all working now except for when someone changes the
classpath container - either the referenced driver changes or they choose a
different driver definition or whatever. You make the change, close the
classpath container wizard, and then have to manually refresh the project to
pick up the updated library path.

Is there a way to force the update to happen when the classpath container
wizard closes? I'd like to avoid the manual step if at all possible.

Thanks in advance!
--Fitz
Re: forcing a project to refresh after updating an IClasspathContainerPage [message #334110 is a reply to message #334055] Wed, 21 January 2009 10:49 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Brian Fitzpatrick wrote:
> Hi all...
>
> I've created a classpath container so that folks can add driver jars to a
> Java project by referencing a DTP Driver Definition. That probably doesn't
> mean much to anybody, but the idea is that someone could easily use parts of
> DTP to jumpstart some JDBC development in a project...
>
> That said, I have it all working now except for when someone changes the
> classpath container - either the referenced driver changes or they choose a
> different driver definition or whatever. You make the change, close the
> classpath container wizard, and then have to manually refresh the project to
> pick up the updated library path.
>
Is it really the project or is some UI (if so, which one) not updated?

Dani
> Is there a way to force the update to happen when the classpath container
> wizard closes? I'd like to avoid the manual step if at all possible.
>
> Thanks in advance!
> --Fitz
>
>
>
Re: forcing a project to refresh after updating an IClasspathContainerPage [message #334125 is a reply to message #334110] Wed, 21 January 2009 15:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brianf.sybase.com

"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:gl6uki$h0j$2@build.eclipse.org...
>Is it really the project or is some UI (if so, which one) not updated?

When I close the wizard to update the classpath, the classpath container is
correct. But I have to refresh (i.e. right-click on project in the Project
Explorer or wherever and actually use the "Refresh" menu or hit F5) to get
the classpath item in the tree beneath the project to accurately reflect the
update.

--Fitz
Re: forcing a project to refresh after updating an IClasspathContainerPage [message #334128 is a reply to message #334125] Wed, 21 January 2009 16:09 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Brian Fitzpatrick wrote:
> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
> news:gl6uki$h0j$2@build.eclipse.org...
>
>> Is it really the project or is some UI (if so, which one) not updated?
>>
>
> When I close the wizard to update the classpath, the classpath container is
> correct. But I have to refresh (i.e. right-click on project in the Project
> Explorer or wherever
Is it really "or whatever" or might it be a bug in that specific view,
e.g. how about the Package Explorer?

Dani
> and actually use the "Refresh" menu or hit F5) to get
> the classpath item in the tree beneath the project to accurately reflect the
> update.
>
> --Fitz
>
>
>
Re: forcing a project to refresh after updating an IClasspathContainerPage [message #334130 is a reply to message #334128] Wed, 21 January 2009 16:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brianf.sybase.com

You are absolutely correct. Sorry for my being vague (not enough caffeine
yet this morning). Package Explorer.

Should I have to signal something to a listener or add a listener somehow? I
looked for a mechanism to do that from the classpath wizard interfaces and
couldn't find one.

--Fitz

"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:gl7hbc$pt6$1@build.eclipse.org...
> Brian Fitzpatrick wrote:
>> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
>> news:gl6uki$h0j$2@build.eclipse.org...
>>
>>> Is it really the project or is some UI (if so, which one) not updated?
>>>
>>
>> When I close the wizard to update the classpath, the classpath container
>> is correct. But I have to refresh (i.e. right-click on project in the
>> Project Explorer or wherever
> Is it really "or whatever" or might it be a bug in that specific view,
> e.g. how about the Package Explorer?
>
> Dani
>> and actually use the "Refresh" menu or hit F5) to get the classpath item
>> in the tree beneath the project to accurately reflect the update.
>>
>> --Fitz
>>
>>
Re: forcing a project to refresh after updating an IClasspathContainerPage [message #334132 is a reply to message #334130] Wed, 21 January 2009 16:52 Go to previous messageGo to next message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
Brian Fitzpatrick wrote:
> You are absolutely correct. Sorry for my being vague (not enough caffeine
> yet this morning). Package Explorer.
>
> Should I have to signal something to a listener or add a listener somehow? I
> looked for a mechanism to do that from the classpath wizard interfaces and
> couldn't find one.
>
If you change the Java build path using
org.eclipse.jdt.core.IJavaProject.setRawClasspath(IClasspath Entry[],
IPath, IProgressMonitor) then this should just work. In case you do more
than one Java operation you should batch it using
org.eclipse.jdt.core.JavaCore.run(IWorkspaceRunnable, ISchedulingRule,
IProgressMonitor).

HTH
Dani
> --Fitz
>
> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
> news:gl7hbc$pt6$1@build.eclipse.org...
>
>> Brian Fitzpatrick wrote:
>>
>>> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
>>> news:gl6uki$h0j$2@build.eclipse.org...
>>>
>>>
>>>> Is it really the project or is some UI (if so, which one) not updated?
>>>>
>>>>
>>> When I close the wizard to update the classpath, the classpath container
>>> is correct. But I have to refresh (i.e. right-click on project in the
>>> Project Explorer or wherever
>>>
>> Is it really "or whatever" or might it be a bug in that specific view,
>> e.g. how about the Package Explorer?
>>
>> Dani
>>
>>> and actually use the "Refresh" menu or hit F5) to get the classpath item
>>> in the tree beneath the project to accurately reflect the update.
>>>
>>> --Fitz
>>>
>>>
>>>
>
>
>
Re: forcing a project to refresh after updating an IClasspathContainerPage [message #334136 is a reply to message #334132] Wed, 21 January 2009 21:40 Go to previous message
Eclipse UserFriend
Originally posted by: brianf.sybase.com

Hey Dani...

I've been using:

JavaCore.setClasspathContainer(null, new IJavaProject[]{fProject}, new
IClasspathContainer[] {oldContainer}, null);

What would be the best way to shift to the IJavaProject.setRawClasspath API?

--Fitz

"Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
news:gl7jt7$k6o$1@build.eclipse.org...
> Brian Fitzpatrick wrote:
>> You are absolutely correct. Sorry for my being vague (not enough caffeine
>> yet this morning). Package Explorer.
>>
>> Should I have to signal something to a listener or add a listener
>> somehow? I looked for a mechanism to do that from the classpath wizard
>> interfaces and couldn't find one.
>>
> If you change the Java build path using
> org.eclipse.jdt.core.IJavaProject.setRawClasspath(IClasspath Entry[],
> IPath, IProgressMonitor) then this should just work. In case you do more
> than one Java operation you should batch it using
> org.eclipse.jdt.core.JavaCore.run(IWorkspaceRunnable, ISchedulingRule,
> IProgressMonitor).
>
> HTH
> Dani
>> --Fitz
>>
>> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
>> news:gl7hbc$pt6$1@build.eclipse.org...
>>
>>> Brian Fitzpatrick wrote:
>>>
>>>> "Daniel Megert" <daniel_megert@ch.ibm.com> wrote in message
>>>> news:gl6uki$h0j$2@build.eclipse.org...
>>>>
>>>>
>>>>> Is it really the project or is some UI (if so, which one) not updated?
>>>>>
>>>>>
>>>> When I close the wizard to update the classpath, the classpath
>>>> container is correct. But I have to refresh (i.e. right-click on
>>>> project in the Project Explorer or wherever
>>>>
>>> Is it really "or whatever" or might it be a bug in that specific view,
>>> e.g. how about the Package Explorer?
>>>
>>> Dani
>>>
>>>> and actually use the "Refresh" menu or hit F5) to get the classpath
>>>> item in the tree beneath the project to accurately reflect the update.
>>>>
>>>> --Fitz
>>>>
>>>>
>>>>
>>
>>
>>
Previous Topic:Access to the workspace on the ntfs from linux eclipse
Next Topic:Eclipse and Ant tasks
Goto Forum:
  


Current Time: Wed Jul 17 22:30:43 GMT 2024

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

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

Back to the top