Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSet Runtime-Classpath (LaunchConfiguration) programmatically
https://www.eclipse.org/forums/index.php/mv/msg/92616/285187/#msg_285187
myPlugin sets for certain javaprojects a nature (extends from
IProjectNature). Now I want to add new runtime-classpath for every
launchconfiguration for this projects. (I want do this programmatically
inside my plugin when I set the nature...).
and I set the attribute "ATTR_CLASSPATH_PROVIDER" with my provider id
"MyClasspathProviderID", like described in the documentation of this
Extension-Point nothing happens...
What do I wrong?
Can someone help me, please?
--
Przemyslaw Dul Przemek_d@gmx.de]]>Przemyslaw Doe2005-05-11T10:33:50-00:00Re: Set Runtime-Classpath (LaunchConfiguration) programmatically
https://www.eclipse.org/forums/index.php/mv/msg/92616/285257/#msg_285257
your launch configs when they are launched, and to resolve the classpath
they compute. See JavaRuntime.computeUnresolvedRuntimeClasspath(...).
Darin
"Przemyslaw" <Przemek_d@gmx.de> wrote in message
news:d5snji$qmp$1@news.eclipse.org...
> Hallo,
> myPlugin sets for certain javaprojects a nature (extends from
> IProjectNature). Now I want to add new runtime-classpath for every
> launchconfiguration for this projects. (I want do this programmatically
> inside my plugin when I set the nature...).
>
> First I tried the Extension:
> Code:
>
> <extension
> point="org.eclipse.jdt.launching.runtimeClasspathEntries">
> <runtimeClasspathEntry
> class="MyPathEntry"
> id="MyPathEntryID">
> </runtimeClasspathEntry>
> </extension>
>
>
> but it did not work.
>
> Then I tried the Extension:
> Code:
>
> <extension
> point="org.eclipse.jdt.launching.classpathProviders">
> <classpathProvider
> class="MyClasspathProvider"
> id="MyClasspathProviderID">
> </classpathProvider>
> </extension>
>
>
> but my class MyClasspathProvider is never executed.
>
> Even if I walk through all launchconfigurations when i set my nature:
> Code:
>
> ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
> ILaunchConfiguration[] lcs = manager.getLaunchConfigurations();
> for (int i = 0; i < lcs.length; i++) {
> ILaunchConfiguration configuration = lcs[i];
> ILaunchConfigurationWorkingCopy wc =
> configuration.getWorkingCopy();
> if(wc.getAttribute("org.eclipse.debug.ui.private", false)) {
> continue;
> }
> wc.setAttribute("ATTR_CLASSPATH_PROVIDER",
> "MyClasspathProviderID");
> wc.doSave();
>
> }
>
>
> and I set the attribute "ATTR_CLASSPATH_PROVIDER" with my provider id
> "MyClasspathProviderID", like described in the documentation of this
> Extension-Point nothing happens...
>
> What do I wrong?
> Can someone help me, please?
>
> --
> Przemyslaw Dul
> Przemek_d@gmx.de
>
>]]>Darin Wright2005-05-12T20:52:39-00:00Re: Set Runtime-Classpath (LaunchConfiguration) programmatically
https://www.eclipse.org/forums/index.php/mv/msg/92616/285291/#msg_285291
since I use IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER
instead of "ATTR_CLASSPATH_PROVIDER", it works...of course.
bye
"Darin Wright" <Darin_Wright@ca.ibm.com> schrieb im Newsbeitrag
news:d60gb9$82c$1@news.eclipse.org...
> Your classpath provider will be asked to compute an unresolved classpath
> for your launch configs when they are launched, and to resolve the
> classpath they compute. See
> JavaRuntime.computeUnresolvedRuntimeClasspath(...).
>
> Darin
>
> "Przemyslaw" <Przemek_d@gmx.de> wrote in message
> news:d5snji$qmp$1@news.eclipse.org...
>> Hallo,
>> myPlugin sets for certain javaprojects a nature (extends from
>> IProjectNature). Now I want to add new runtime-classpath for every
>> launchconfiguration for this projects. (I want do this programmatically
>> inside my plugin when I set the nature...).
>>
>> First I tried the Extension:
>> Code:
>>
>> <extension
>> point="org.eclipse.jdt.launching.runtimeClasspathEntries">
>> <runtimeClasspathEntry
>> class="MyPathEntry"
>> id="MyPathEntryID">
>> </runtimeClasspathEntry>
>> </extension>
>>
>>
>> but it did not work.
>>
>> Then I tried the Extension:
>> Code:
>>
>> <extension
>> point="org.eclipse.jdt.launching.classpathProviders">
>> <classpathProvider
>> class="MyClasspathProvider"
>> id="MyClasspathProviderID">
>> </classpathProvider>
>> </extension>
>>
>>
>> but my class MyClasspathProvider is never executed.
>>
>> Even if I walk through all launchconfigurations when i set my nature:
>> Code:
>>
>> ILaunchManager manager =
>> DebugPlugin.getDefault().getLaunchManager();
>> ILaunchConfiguration[] lcs =
>> manager.getLaunchConfigurations();
>> for (int i = 0; i < lcs.length; i++) {
>> ILaunchConfiguration configuration = lcs[i];
>> ILaunchConfigurationWorkingCopy wc =
>> configuration.getWorkingCopy();
>> if(wc.getAttribute("org.eclipse.debug.ui.private", false))
>> {
>> continue;
>> }
>> wc.setAttribute("ATTR_CLASSPATH_PROVIDER",
>> "MyClasspathProviderID");
>> wc.doSave();
>>
>> }
>>
>>
>> and I set the attribute "ATTR_CLASSPATH_PROVIDER" with my provider id
>> "MyClasspathProviderID", like described in the documentation of this
>> Extension-Point nothing happens...
>>
>> What do I wrong?
>> Can someone help me, please?
>>
>> --
>> Przemyslaw Dul
>> Przemek_d@gmx.de
>>
>>
>
>]]>Przemyslaw Doe2005-05-14T00:48:24-00:00Re: Set Runtime-Classpath (LaunchConfiguration) programmatically
https://www.eclipse.org/forums/index.php/mv/msg/92616/1781325/#msg_1781325
But I could not fined details on org.eclipse.jdt.launching.classpathProviders i.e. how to implement MyClasspathProvider and what to return for computeUnresolvedClasspath() and resolveClasspath() methods? Can someone provide me with explanation of these methods?