예제 #1
0
 public File reparseBefore() {
   Element e = this.getDocument().getDefaultRootElement();
   if (e.getEndOffset() - e.getStartOffset() == 1) {
     return null;
   }
   File temp = FileManager.createTempFile("reparse");
   try {
     writeFile(temp.getAbsolutePath());
     return temp;
   } catch (IOException ex) {
   }
   return null;
 }
예제 #2
0
 private void writeSrcFile() throws IOException {
   Debug.log(3, "IDE: writeSrcFile: " + _editingFile.getName());
   writeFile(_editingFile.getAbsolutePath());
   if (PreferencesUser.getInstance().getAtSaveMakeHTML()) {
     convertSrcToHtml(getSrcBundle());
   } else {
     String snameDir = new File(_editingFile.getAbsolutePath()).getParentFile().getName();
     String sname = snameDir.replace(".sikuli", "") + ".html";
     (new File(snameDir, sname)).delete();
   }
   if (PreferencesUser.getInstance().getAtSaveCleanBundle()) {
     cleanBundle(getSrcBundle());
   }
   setDirty(false);
 }
예제 #3
0
  public String exportAsZip() throws IOException, FileNotFoundException {
    File file = new SikuliIDEFileChooser(SikuliIDE.getInstance()).export();
    if (file == null) {
      return null;
    }

    String zipPath = file.getAbsolutePath();
    String srcName = file.getName();
    if (!file.getAbsolutePath().endsWith(".skl")) {
      zipPath += ".skl";
    } else {
      srcName = srcName.substring(0, srcName.lastIndexOf('.'));
    }
    writeFile(getSrcBundle() + srcName + ".py");
    FileManager.zip(getSrcBundle(), zipPath);
    Debug.log(2, "export to executable file: " + zipPath);
    return zipPath;
  }