forcing a project to refresh after updating an IClasspathContainerPage [message #334055] |
Fri, 16 January 2009 17:07 |
Eclipse User |
|
|
|
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 #334130 is a reply to message #334128] |
Wed, 21 January 2009 16:20 |
Eclipse User |
|
|
|
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 #334136 is a reply to message #334132] |
Wed, 21 January 2009 21:40 |
Eclipse User |
|
|
|
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
>>>>
>>>>
>>>>
>>
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04116 seconds