/** * Validates the destination file if it is read-only and additionally the source file if both are * read-only. Returns true if both files could be made writeable. * * @param source source file * @param destination destination file * @param shell ui context for the validation * @return boolean <code>true</code> both files could be made writeable. <code>false</code> either * one or both files were not made writeable */ boolean validateEdit(IFile source, IFile destination, Shell shell) { if (destination.isReadOnly()) { IWorkspace workspace = ModelerCore.getWorkspace(); IStatus status; if (source.isReadOnly()) status = workspace.validateEdit(new IFile[] {source, destination}, shell); else status = workspace.validateEdit(new IFile[] {destination}, shell); return status.isOK(); } return true; }