From: Jonathan L. <jl...@ri...> - 2004-03-10 05:57:16
|
In terms of implementation, I believe it is quite easy to programmatically change the default abstract path used by most file IO. The java.io.File class uses the System property, "user.dir" when determining the file's absolute path. This property is easily changed by using the following code: System.setProperty("user.dir", "<<default directory>>");. I ran the following code in the interactions pane and it successfully changed the output of the getAbsolutePath() method of a java.io.File object. It also worked on java's XML parser. If this system change could be made in the interactions pane, could it be done as easily behind the scenes by drjava? We could have some sort of code that chooses a good default based on the open/selected files that can be overruled by the user easily. There could be a "change current working directory" button on the interactions pane. This concept could also be applied to Unit testing just incase. I admit that I have not thoroughly researched the repercussions of changing this system property, but I know the change lasted only until I reset the interactions pane again. - Jonathan Lugo |