Esempio n. 1
0
 /**
  * Choose a unique tab file.
  *
  * @return io reference
  */
 private IOFile newTabFile() {
   // collect numbers of existing files
   final BoolList bl = new BoolList();
   for (final EditorArea edit : editors()) {
     if (edit.opened()) continue;
     final String n = edit.file.name().substring(FILE.length());
     bl.set(n.isEmpty() ? 1 : Integer.parseInt(n), true);
   }
   // find first free file number
   int c = 0;
   while (++c < bl.size() && bl.get(c)) ;
   // create io reference
   return new IOFile(gui.gprop.get(GUIProp.WORKPATH), FILE + (c == 1 ? "" : c));
 }