When opening a file that is not writable by the current user, jEdit should check whether the user wants to open the file read-only or as superuser / another user. Here's an imagined workflow:
1. According to the principle of least privilege, start by notifying the user that the file cannot be modified with the current privileges. Ask if the user wants to open read-only or read-write (and maybe a check box to use the same option for all other files opened at the same time).
2. If the user selected read-write, display the users/groups which have write access and user/password boxes. If the user is also a member of sudoers, there could be a check box to use sudo which would gray out the user box and focus the password.