Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-debug-dev] Computing default classpath and sourcelookup


You have your own tab group?

Darin



Matt_Lavin@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

05/10/2002 04:12 PM
Please respond to jdt-debug-dev

       
        To:        jdt-debug-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [jdt-debug-dev] Computing default classpath and sourcelookup



My thought was that the tab group would set the value.  Since it gets called with the setDefaults() first.



Darin_Wright@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

05/10/2002 05:00 PM
Please respond to jdt-debug-dev

       
       To:        jdt-debug-dev@xxxxxxxxxxx
       cc:        
       Subject:        Re: [jdt-debug-dev] Computing default classpath and sourcelookup




How would the ATTR_DEFAULT_CLASSPATH_PROVIDER and ATTR_DEFAULT_SOURCE_PROVIDER attributes get set? I don't see an obvious place in the lifecycle of the java launch config for this to happen (unless you are programatically creating your own configs).

Darin


Matt_Lavin@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

05/09/2002 10:49 AM
Please respond to jdt-debug-dev

       
      To:        jdt-debug-dev@xxxxxxxxxxx
      cc:        
      Subject:        Re: [jdt-debug-dev] Computing default classpath and sourcelookup





I have been thinking about this most of the morning and here are what I think the changes would be.  Note: these changes to not break current behavior, and do not require any changes to the current API ( other than two new, optional, interfaces ).  

New Interfaces ( non-UI )
* IDefaultClasspathProvider would contain a single method like
     IRuntimeClasspathEntry[]
computeDefaultClasspath(ILaunchConfiguration config);
* IDefaultSourceProvider would contain a single method like
     IRuntimeClasspathEntry[]
computeDefaultSource(ILaunchConfiguration config);

New extension points ( non-UI )
* Allow plugins to register new default classpath providers and default source providers with unqiue keys
* For example, the extension point might look like.....
<extension
      point=
"org.eclipse.jdt.debug.defaultsProvider">
   
<classpathProvider
         class=
"org.eclipse.jdt.debug.StandardClasspathProvider"
         id=
"org.eclipse.jdt.debug.StandardClasspathProvider"/>
   
</classpathProvider>
   
<sourceProvider
         class=
"org.eclipse.jdt.debug.StandardSourceProvider"
         id=
"org.eclipse.jdt.debug.StandardSourceProvider"/>
   
</sourceProvider>
</extension>

IJavaLaunchConfigurationConstants changes ( non-UI )
* Two new attribute key should be added ATTR_DEFAULT_CLASSPATH_PROVIDER and ATTR_DEFAULT_SOURCE_PROVIDER
* The expected value of those two attributes  would be a unique key that the extension point defined
     ie.
org.eclipse.jdt.debug.StandardClasspathProvider

AbstractJavaLaunchConfigurationDelegate changes ( non-UI )
* IRuntimeClasspathEntry[] getRuntimeClasspath(ILaunchConfiguration configuration) would be changed so that  if the configuration specified to use the default classpath and the ATTR_DEFAULT_CLASSPATH_PROVIDER attribute was defined it would load the extension and compute the default that way.  If the attribute was missing it could just compute the default the was it is done currently.
* The exact same process would be done when computing the source lookup path.  Of course, right now the source lookup computation is not done in the AbstractJavaLaunchConfigurationDelegate, but I entered a bug for that =).  
Bug 15581.

SourceLookupBlock changes ( UI )
* When the 'use default' button is selected the default would be computed using the ATTR_DEFAULT_SOURCE_PROVIDER attribute if it is set.  That way the user could see what the defaults are before a launch.  If the attribute is not set then the current way of computing defaults could be used.

JavaClasspathTab changes ( UI )
* Basicly the same changes as SourceLookupBlock, just to allow the user to see the default classpath.

Darin_Wright@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

05/09/2002 11:05 AM
Please respond to jdt-debug-dev

       
     To:        jdt-debug-dev@xxxxxxxxxxx
     cc:        
     Subject:        Re: [jdt-debug-dev] Computing default classpath and sourcelookup






We will take your suggestion into consideration (and yes, time is running out). The API cannot exist on the tabs, as launching must work in the headless (no UI) case. Please recommend an API that works in the headless case.

Thanks,

Darin
Matt_Lavin@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

05/09/2002 09:58 AM
Please respond to jdt-debug-dev

       
    To:        jdt-debug-dev@xxxxxxxxxxx
    cc:        
    Subject:        Re: [jdt-debug-dev] Computing default classpath and sourcelookup







I understand that a code freeze is coming towards the eclipse team very quickly, and that this kinda of thing might not be very high on the priority list.  However, it will be more more work for me to come up with some workaround then to just fix the problem.  So, if there doesn't seem to be enough time to get this change in for 2.0 I would be more than happy to contribute the nessecary changes.  
Matt_Lavin@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

05/08/2002 11:18 AM
Please respond to jdt-debug-dev

       
   To:        jdt-debug-dev@xxxxxxxxxxx
   cc:        
   Subject:        Re: [jdt-debug-dev] Computing default classpath and sourcelookup








The classpath on my launch be default consists of only two external jars.  However, my source lookup path is a set of projects that I can compute when needed.  

Hardcoding the way defaults are computed basicly ties the java launch delegate to launches that are project based ( something I thought was trying to be avoided ).  If the two boolean flags were changed to point to classes that could compute the defaults then the launch delegate would be significantly more flexible.  

A simple interface with a single method like the following would be good....


 
public IRuntimeClasspathEntry[] computeSourceEntries(ILaunchConfiguration config);

A similar thing could be done with default classpath.  No function would be lost, and the java launch configuration tab group could just use some default java setting computer which looks at the config and finds the project and does whatever it wants with it.  When the attribute is set, then the source/classpath computer is called before every launch to determine the defaults.
Darin_Wright@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

05/08/2002 10:20 AM
Please respond to jdt-debug-dev

       
  To:        jdt-debug-dev@xxxxxxxxxxx
  cc:        
  Subject:        Re: [jdt-debug-dev] Computing default classpath and sourcelookup









Do you mean that you launch does not map to any project, or it maps to more than one project? The current classpath computation performs a transitive closure on required projects, and the source lookup path is the same as the classpath (by default). If your launch maps to more than one project, why is this not described in the "build path"?

Currently, there is no way for you to override the classpath computation, except to define a new type of launch configuration, and subclass AbstractJavaLaunchConfigurationDelegate overriding the appropriate methods. You would also need to set a source lookup path explicitly.

Darin
Matt_Lavin@xxxxxxx
Sent by: jdt-debug-dev-admin@xxxxxxxxxxx

05/08/2002 09:03 AM
Please respond to jdt-debug-dev

       
 To:        jdt-debug-dev@xxxxxxxxxxx
 cc:        
 Subject:        [jdt-debug-dev] Computing default classpath and sourcelookup










If I have a launch configuration object and set either ATTR_DEFAULT_SOURCE_PATH and ATTR_DEFAULT_CLASSPATH to true then the default values for the respective attributes are computed each time the configuration is launched.  This works great since new additions to a projects classpath will be added on every launch.  Since my launch does not directly map to one project, I would like to be able to change how the default source lookup path and default classpath are computed.... how can I do this?









Back to the top