home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 67 / IOPROG_67A.ISO / soft / Tools / mwsppv4.exe / CREATEHTMLTESTFILE.SCRIPT < prev    next >
Encoding:
Text File  |  2001-10-20  |  1.0 KB  |  40 lines

  1. !!script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. function DoCommand()
  5. {
  6.   var file = chooseFile("Choose an applet that needs a HTML test file", 
  7.     "*.java", "*.java");
  8.   if (file)
  9.   {
  10.     CreateHtmlTestFile(file);
  11.   }
  12. }
  13.  
  14. function CreateHtmlTestFile(file)
  15. {
  16.   var htmlFile = file.newType(".html");
  17.   var classTitle = file.title;
  18.   var editor = newEditor(htmlFile.path, true);
  19.   if (editor)
  20.   {
  21.     editor.removeAll();
  22.     
  23.     editor.append("<html>\n");
  24.     editor.append("<head>\n");
  25.     editor.append("<meta name=\"generator\" content=\"Modelworks IDE\">\n");
  26.     editor.append("<title>" + classTitle +"</title>\n");
  27.     editor.append("</head>\n");
  28.     editor.append("<body>\n");
  29.     editor.append("<h1>Test page for "+ classTitle + " Class</h1><hr>\n");
  30.     editor.append("<applet code="+ classTitle +".class width=300 height=300></applet>\n");
  31.     editor.append("<hr></body>\n");
  32.     editor.append("</html>\n");
  33.     editor.setActive("Insert HTML Test Code");
  34.     editor.save();
  35.   }
  36. }
  37.  
  38. !!/script
  39.  
  40.