Exemplo n.º 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;
 }
Exemplo n.º 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();
 }
Exemplo n.º 3
0
 public static String getSettingsDirectory() {
   if (insideJEdit()) return jEdit.getSettingsDirectory();
   else return System.getProperty("jedit.settings.dir");
 }