@Override public void setModified(boolean modif) { super.setModified(modif); if (!modif) { GenericEditorSupport ges = getLookup().lookup(GenericEditorSupport.class); // defect #203688, probably file deletion in parallel with DO's creation - not completed, so // cookie not registered yet. if (ges != null) { ges.removeSaveCookie(); } } }
/* * @see org.openide.loaders.DataObject#setModified(boolean) */ public void setModified(boolean isModified) { // I tied the SaveCookie implementation into this such that // the Save action is enabled whenever the object is modified. if (isModified) { if (getCookie(SaveCookie.class) == null) { getCookieSet().add(saveCookie); } } else { SaveCookie cookie = (SaveCookie) getCookie(SaveCookie.class); if (cookie != null) { getCookieSet().remove(cookie); } } super.setModified(isModified); }