Posted By

thebugslayer on 06/02/07


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

laurenceosx


jEdit's Plugin: Commamdo config for groovy


 / Published in: XML
 

This allow running groovy inside jEdit Copy it to $HOME/.jedit/console/commando

  1. <?xml version="1.0"?>
  2. <!DOCTYPE COMMANDO SYSTEM "commando.dtd">
  3. <!-- Quick Groovy Commando Command -->
  4. <COMMANDO>
  5. <UI>
  6. <CAPTION LABEL="Source File(s)">
  7. <FILE_ENTRY LABEL="File Name" VARNAME="file"
  8. EVAL="buffer.getPath()"/>
  9. </CAPTION>
  10. <CAPTION LABEL="Interpreter Options">
  11. <CHOICE LABEL="Action" VARNAME="action" DEFAULT="run">
  12. <OPTION LABEL="Run" VALUE="run"/>
  13. </CHOICE>
  14. <CHOICE LABEL="Safety" VARNAME="safety" DEFAULT="0">
  15. <OPTION LABEL="Unsafe" VALUE="0"/>
  16. <OPTION LABEL="Low" VALUE="1"/>
  17. <OPTION LABEL="Medium" VALUE="2"/>
  18. <OPTION LABEL="High" VALUE="3"/>
  19. <OPTION LABEL="Sandbox" VALUE="4"/>
  20. </CHOICE>
  21. <CHOICE LABEL="Warnings" VARNAME="warning" DEFAULT="2">
  22. <OPTION LABEL="No Warnings" VALUE="0"/>
  23. <OPTION LABEL="Simple Warnings" VALUE="1"/>
  24. <OPTION LABEL="Full Warnings" VALUE="2"/>
  25. </CHOICE>
  26. <ENTRY LABEL="Source File Encoding" VARNAME="encoding"
  27. EVAL="buffer.getProperty(Buffer.ENCODING)"/>
  28. <TOGGLE LABEL="Switches are global variables"
  29. VARNAME="transform" DEFAULT="FALSE"/>
  30. <TOGGLE LABEL="Verbose output" VARNAME="verbose" DEFAULT="FALSE"/>
  31. <TOGGLE LABEL="Embedded Groovy script" VARNAME="embedded"
  32. DEFAULT="FALSE"/>
  33. <ENTRY LABEL="Other Options" VARNAME="other"/>
  34. </CAPTION>
  35. <CAPTION LABEL="Script Options">
  36. <ENTRY LABEL="Script Command-Line Arguments" VARNAME="arguments"/>
  37. </CAPTION>
  38. </UI>
  39. <COMMANDS>
  40. <COMMAND SHELL="System" CONFIRM="FALSE">
  41. buf = new StringBuffer();
  42. buf.append("/opt/groovy-1.0/bin/groovy");
  43. buf.append(" \""+file+"\"");
  44. if(!arguments.equals(""))
  45. buf.append(" "+arguments);
  46. // return value
  47. buf.toString();
  48. </COMMAND>
  49. </COMMANDS>
  50. </COMMANDO>

Report this snippet  

You need to login to post a comment.