Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
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:
public static final int ERROR_LEVEL = 5; public static final int WARNING_LEVEL = 4; public static final int INFO_LEVEL = 3; public static final int TRACE_LEVEL = 2; public static final int DEBUG_LEVEL = 1;
A future JET release will make these public.
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).
TODO: Show example here
TODO
See Also
JET FAQ How do I run a JET transformation from Java?
Back to M2T-JET-FAQ