/** Reverse method that can be called to make the environment * unmodified. */ public void unmarkModified() { getDataObject ().setModified (false); }
/** Support for marking the environement modified. * @exception IOException if the environment cannot be marked modified * (for example when the file is readonly), when such exception * is the support should discard all previous changes */ public void markModified() throws java.io.IOException { getDataObject ().setModified (true); }
public void save () throws IOException { saveDocument (); getDataObject ().setModified (false); } }
@Override public void save() throws java.io.IOException { ((J2MEEditorSupport) findCloneableOpenSupport()).saveDocument(); getDataObject().setModified(false); } }
public void save() throws java.io.IOException { ((GenericEditorSupport)findCloneableOpenSupport()).saveDocument(); getDataObject().setModified(false); } }
/** Tries to mark the object invalid. Called from setValid or from * MultiDataObject.notifyDeleted */ final void markInvalid0 () throws PropertyVetoException { fireVetoableChange (PROP_VALID, Boolean.TRUE, Boolean.FALSE); dispose (); setModified(false); }
/** Helper method. Removes save cookie from the data object. */ private void removeSaveCookie() { DataObject obj = getDataObject(); // Remove save cookie from the data object. Cookie cookie = obj.getCookie(SaveCookie.class); if(cookie != null && cookie.equals(saveCookie)) { set.remove(saveCookie); obj.setModified(false); } }
/** Helper method. Adds save cookie to the data object. */ private void addSaveCookie() { DataObject obj = getDataObject(); // Adds save cookie to the data object. if(obj.getCookie(SaveCookie.class) == null) { set.add(saveCookie); obj.setModified(true); } }
/** Reverse method that can be called to make the environment * unmodified. */ public void unmarkModified() { if (fileLock != null && fileLock.isValid()) { fileLock.releaseLock(); } this.getDataObject ().setModified (false); }
protected void notifyUnmodified () { super.notifyUnmodified (); SaveCookie save = (SaveCookie) getDataObject ().getCookie (SaveCookie.class); if (save != null) { ((XMLDataObject) getDataObject ()).removeSaveCookie (save); getDataObject ().setModified (false); } }
protected boolean notifyModified () { if (! super.notifyModified ()) { return false; } if (getDataObject ().getCookie (SaveCookie.class) == null) { ((XMLDataObject) getDataObject ()).addSaveCookie (new Save ()); getDataObject ().setModified (true); } return true; } protected void notifyUnmodified () {
/** First of all tries to lock the primary file and * if it succeeds it marks the data object modified. * <p><b>Note: There is a contract (better saying a curse) * that this method has to call {@link #takeLock} method * in order to keep working some special filesystem's feature. * See <a href="http://www.netbeans.org/issues/show_bug.cgi?id=28212">issue #28212</a></b>. * * @exception IOException if the environment cannot be marked modified * (for example when the file is readonly), when such exception * is the support should discard all previous changes * @see org.openide.filesystems.FileObject#isReadOnly */ public void markModified() throws java.io.IOException { // XXX This shouldn't be here. But it is due to the 'contract', // see javadoc to this method. if (fileLock == null || !fileLock.isValid()) { fileLock = takeLock (); } if(getFileImpl().isReadOnly()) { if(fileLock != null && fileLock.isValid()) { fileLock.releaseLock(); } throw new IOException("File " // NOI18N + getFileImpl().getNameExt() + " is read-only!"); // NOI18N } this.getDataObject ().setModified (true); }