private void lockFile() { OpenFileHandler ofh=(OpenFileHandler)getJPE().getHandler("Opened"); Editor editor=(Editor)getJPE().getEditor(); if (editor!=null) { OpenFile file=editor.getEditFile(); if (file.isLocked()) { file.clearLocked(); getJPE().setLockState(false); getJPE().say("file is now unlocked ( read / write )"); } else { file.setLocked(); getJPE().setLockState(true); getJPE().say("file is now locked (read only)"); } ofh.updateProperties(); } }