JET FAQ How do I get a console when running JET from Java?

Question

The JET2Platform API runs JET transformations, but does not create an execution console like the the JET UI does. How do I run a JET transformation from my project, and get an execution console?

Answer

The JET UI uses Eclipse launch configurations to describe a JET launch.
Your code can use the org.eclipse.debug.core plug-in to construct a JET launch configuration, and then to run it.

JET provides a class, org.eclipse.jet.transform.JETLaunchConstants, which contains the constants needed to configure the JET specific parts of a launch configuration. Unfortunately, the logging level constants required by the LOG_FILTER_LEVEL launch parameter are private. Here are the values, as defined:

To configure the options from the Common tab of the JET launch configuration dialog, your code needs to reference org.eclipse.debug.ui.IDebugUIConstants (which is defined in the org.eclipse.debug.ui plug-in).