/** * Saves this file in a new local location. This method fires a property * change event of type {@link #FULL_PATH_PROPERTY}. * * @param loc The location to save to. * @throws IOException If an IO error occurs. * @see #save() * @see #load(FileLocation, String) */ public void saveAs(FileLocation loc) throws IOException { saveImpl(loc); // No exception thrown - we can "rename" the file. String old = getFileFullPath(); this.loc = loc; setDirty(false); lastSaveOrLoadTime = loc.getActualLastModified(); firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath()); }
String old = getFileFullPath(); this.loc = loc; setDirty(false); setCaretPosition(0); discardAllEdits(); firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath());
/** * Returns the location of the <code>.jshintrc</code> file to use if using * JsHint as your error parser. * * @param textArea The text component. * @return The <code>.jshintrc</code> file, or <code>null</code> if none; * in that case, the JsHint defaults will be used. */ public File getJsHintRCFile(RSyntaxTextArea textArea) { // First, get the .jshintrc file in the current file's folder // hierarchy, if it exists. if (textArea instanceof TextEditorPane) { TextEditorPane tep = (TextEditorPane)textArea; File file = new File(tep.getFileFullPath()); File parent = file.getParentFile(); while (parent != null) { File possibleJsHintRc = new File(parent, ".jshintrc"); if (possibleJsHintRc.isFile()) { return possibleJsHintRc; } parent = parent.getParentFile(); } } // If no .jshintrc is found, use the specified fallback. return langSupport.getDefaultJsHintRCFile(); }
/** * Saves this file in a new local location. This method fires a property * change event of type {@link #FULL_PATH_PROPERTY}. * * @param loc The location to save to. * @throws IOException If an IO error occurs. * @see #save() * @see #load(FileLocation, String) */ public void saveAs(FileLocation loc) throws IOException { saveImpl(loc); // No exception thrown - we can "rename" the file. String old = getFileFullPath(); this.loc = loc; setDirty(false); lastSaveOrLoadTime = loc.getActualLastModified(); firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath()); }
/** * Saves this file in a new local location. This method fires a property * change event of type {@link #FULL_PATH_PROPERTY}. * * @param loc The location to save to. * @throws IOException If an IO error occurs. * @see #save() * @see #load(FileLocation, String) */ public void saveAs(FileLocation loc) throws IOException { saveImpl(loc); // No exception thrown - we can "rename" the file. String old = getFileFullPath(); this.loc = loc; setDirty(false); lastSaveOrLoadTime = loc.getActualLastModified(); firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath()); }
/** * Saves this file in a new local location. This method fires a property * change event of type {@link #FULL_PATH_PROPERTY}. * * @param loc The location to save to. * @throws IOException If an IO error occurs. * @see #save() * @see #load(FileLocation, String) */ public void saveAs(FileLocation loc) throws IOException { saveImpl(loc); // No exception thrown - we can "rename" the file. String old = getFileFullPath(); this.loc = loc; setDirty(false); lastSaveOrLoadTime = loc.getActualLastModified(); firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath()); }
String old = getFileFullPath(); this.loc = loc; setDirty(false); setCaretPosition(0); discardAllEdits(); firePropertyChange(FULL_PATH_PROPERTY, old, getFileFullPath());