Jump to: navigation, search

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

Revision as of 10:46, 22 June 2007 by Pelder.ca.ibm.com (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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