Beispiel #1
0
 public static Buffer createFeatureBuffer() {
   View view = jEdit.getActiveView();
   String parent = null;
   if (view != null) {
     Buffer buffer = view.getBuffer();
     parent = buffer.getDirectory();
   }
   if (parent == null) {
     parent = System.getProperty("user.home");
   }
   VFS vfs = VFSManager.getVFSForPath(parent);
   if ((vfs.getCapabilities() & VFS.WRITE_CAP) == 0) {
     // cannot write on that VFS, creating untitled buffer in home directory
     parent = System.getProperty("user.home");
   }
   Buffer buffer = jEdit.openTemporary(view, tempPath(), getNextFeatureTemp(), true, null);
   jEdit.commitTemporary(buffer);
   return buffer;
 }
Beispiel #2
0
 static {
   if (!insideJEdit()) {
     String part = System.getProperty("plugin.props");
     String fileName = pathCombine(relativePath(), part);
     if (!fileExists(fileName)) {
       fileName = resourceUrlOf(part, Constraint.END).toString();
     }
     properties = loadProperties(fileName);
   }
   messageRedirection();
 }
Beispiel #3
0
 public static String getSettingsDirectory() {
   if (insideJEdit()) return jEdit.getSettingsDirectory();
   else return System.getProperty("jedit.settings.dir");
 }