Bug 562844 - Provide API to access default execution environment
Summary: Provide API to access default execution environment
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 4.16   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-05 13:19 EDT by Christopher Gerking CLA
Modified: 2020-05-07 04:24 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Gerking CLA 2020-05-05 13:19:23 EDT
The Eclipse QVTo project uses JDT's interfaces to configure new user projects such that they involve a Java build. To configure these projects, QVTo also requires an indication of the default execution environment. Unfortunately, there is no way to access JDT's getDefaultEEName() because it is part of the UI classes.

To avoid code duplication, would you consider moving that method to a utility class that is publicly accessible?
Comment 1 Manoj N Palat CLA 2020-05-05 13:54:56 EDT
Moving to jdt.ui
Comment 2 Noopur Gupta CLA 2020-05-06 04:30:07 EDT
JDT Debug should already be providing APIs for the clients to access the default execution environment. Can you explore them and see if they suffice?

What additional information is required from jdt.ui?

Also, I see an internal helper class org.eclipse.pde.internal.launching.launcher.VMHelper in PDE which shows how to use the existing APIs.
Comment 3 Christopher Gerking CLA 2020-05-06 10:09:23 EDT
(In reply to Noopur Gupta from comment #2)
> JDT Debug should already be providing APIs for the clients to access the
> default execution environment. Can you explore them and see if they suffice?
Not sure which APIs you mean exactly.

> What additional information is required from jdt.ui?
Basically I was just wondering whether the getDefaultEEName() method could be moved from NewJavaProjectWizardPageOne$JREGroup to a public place like JavaCore, JavaRuntime, or JavaModelUtil. Maybe JavaRuntime is most appropriate as it already deals with execution environments. Instead of a String, returning the default IExecutionEnvironment directly would fit our purpose even better.
Comment 4 Noopur Gupta CLA 2020-05-07 04:24:28 EDT
(In reply to Christopher Gerking from comment #3)
> Maybe JavaRuntime is most
> appropriate as it already deals with execution environments. Instead of a
> String, returning the default IExecutionEnvironment directly would fit our
> purpose even better.

I think JavaRuntime should provide an API to get the default execution environment. Moving to Debug for consideration.