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