Author Topic: Programmatically add a Java Class import  (Read 4225 times)

PlanetPratt

  • Senior Community Member
  • Posts: 145
  • Hero Points: 6
Programmatically add a Java Class import
« on: June 30, 2010, 10:32:04 PM »
Is it possible, through the SlickC Macro Language, to interface with the "Organize Imports" feature for Java files and add an import statement if it doesn't already exist?

I'd love to be able to do something like:

Code: [Select]
add_import("org.apache.log4j.Logger");
from a macro script and have it add the import at the right place at the top of the file, if it doesn't already exist.  

Is there a way to accomplish this?
  (*Chris*)
« Last Edit: July 18, 2010, 10:57:36 PM by PlanetPratt »