I was trying to open a project file as a text file in
DrJava to view its contents. So, I clicked the "Open"
button, and then set the File Type filter to ".pjt"
(one of the drop down options). When I selected the
appropriate project file and clicked on "OK" my project
was opened as a project file--i.e. the entire project
opened.
I then closed my project and pressed the "Open" button
again. This time, I did not set the File Type filter
to .pjt, but instead left it as "Java Source Files" and
simply typed in the name of the .pjt file I wanted to
open. When I clicked on "OK" my project was opened as
a regular file.
I closed the file and tried one last thing. This time,
I pressed the "Open" button and set the File Type
filter to "All Files". When I again selected the
project file I wanted to open and clicked on "OK" the
file was again opened as a regular file.
I find this lack of standardization
confusing--personally, I do not think you should be
able to use the "Open" button to open a project as a
project. That is what "Project, Open" is for.
However, if we do want to keep the option of opening
projects from the Open button, I would like to see it
standardized so that how the file is opened is not tied
to the filter you have selected--not all users always
use the filter.
The four options I can come up with off the top of my
head are:
1. Do not allow projects to be opened as projects from
the Open button.
2. Always open .pjt files as projects if the Open
button is used. Require an explicit "File, Open" to
open a project file as a regular file.
3. Make the behavior of the Open button something the
user sets in their preferences--either always open
project files as projects from the open button or never do.
4. Add a checkbox to the file dialog box that asks if
you want to open the project file as a project (or some
other type of dialog box that comes up during the process).
I'm sure there are other solutions I haven't thought of
yet.