Community
Participate
Working Groups
We should be able to create a default Java Project pretty easily. If there are no Java Projects in the workspace, then create the default one. If there is only one Java Project in the workspace, we should assume that the user wants to create the class there. If the user has a Java Project selected (or one of it descendants), assume that the user wants to create the class there. We may consider adding a hint to in the New Class wizard indicating that the class file can be dragged into an alternate location.
Maxime Caron and me are working on that.
Created attachment 149235 [details] Add a page to the class wizard. Add a page to the class wizard when there's 2 projects or more in the project explorer and none is selected. The new page show the list of project so the user can choose to which project he wants to add the new class.
Oh, sorry, the last attachment was more for https://bugs.eclipse.org/bugs/show_bug.cgi?id=246163 (I can't see an edit button to edit the post I wrote, is this normal?)
Comment on attachment 149235 [details] Add a page to the class wizard. Marking attachment as obsolete.
(In reply to comment #3) > Oh, sorry, the last attachment was more for > https://bugs.eclipse.org/bugs/show_bug.cgi?id=246163 > > (I can't see an edit button to edit the post I wrote, is this normal?) Once you make a comment, it's here forever.
Created attachment 149284 [details] Default MyAssignment project Instead of a messagebox asking if the user want to create a java project, a default project is automaticaly created.
I applied this patch to my workspace and it seems to work as I would expect. However, Wayne mentioned the following in his first comment: "We may consider adding a hint to in the New Class wizard indicating that the class file can be dragged into an alternate location." I actually wasn't able to drag a class to a new location, although I can when not in the Java Lite perspective. If it's supposed to be possible to drag a class (maybe it is and it's a problem on my end?), I do like the idea of adding a hint to the New Class wizard though, so the student doesn't feel restricted to where the class was created by default. It seems to me that this default MyAssignment project should also be created when the student tries to create a package in an empty workspace. Is this something new that needs to be addressed?
(In reply to comment #7) > I applied this patch to my workspace and it seems to work as I would expect. > However, Wayne mentioned the following in his first comment: > > "We may consider adding a hint to in the New Class wizard indicating that the > class file can be dragged into an alternate location." I honestly don't know what I was thinking. Perhaps I meant that the wizard should indicate that the file can moved at some future point if necessary and that the student shouldn't worry about where it's being created. In retrospect, maybe it's just not worth saying. Here's the lesson... capture your entire thought, not just some pithy sentence that inadequately reflects your thoughts... > > I actually wasn't able to drag a class to a new location, although I can when > not in the Java Lite perspective. If it's supposed to be possible to drag a > class (maybe it is and it's a problem on my end?), I do like the idea of adding > a hint to the New Class wizard though, so the student doesn't feel restricted > to where the class was created by default. Part of what we're trying to do is avoid overloading the student with concerns. I'm inclined to have as little text/information as possible in these "simplified" wizards. > It seems to me that this default MyAssignment project should also be created > when the student tries to create a package in an empty workspace. Is this > something new that needs to be addressed? Agreed.
When the new project is automagically created, a src and bin folder is created by default. But when we create a new project explicitly the src and bin folders are not created. I prefer this behaviour since there will not be any need for src and bin folders when students are working on small beginner level assignments. One folder with their .java and .class files in it should be fine. I've worked on this and fixed it. I will attach a patch for this.
Created attachment 156322 [details] Default MyAssignment project, no src or bin folders created This patch makes the patch from Oct. 9 obsolete. We simply need to change the preferences for new project creation before creating the MyAssignment project.
Created attachment 156330 [details] Default MyAssignment project, no src or bin folders created, fixed Ooops! I haven't made a patch before. Lesson learned. Now I know, only create a patch when you don't have any other patches for other bugs applied. This version works. Enjoy.
Let me apologise in advance. I apologise. The solution we have here makes me feel icky. We're basically hacking the crap out of a wizard that we've liberated from the JDT project. I don't think that this is the right approach. For starters, all those compiler warnings are a good indication that we're doing it wrong. I open Bug 299332 to address this, at least in part. With this bug, I would like to separate out the two different aspects of class creation. Bug 299332 addresses the Java project creation problem by introducing the notion of a "Java Project Constructor". I will open a new bug to create a "Java Class Constructor" object. All of the code that we need to build the suggested "constructor" object is contained in the JDT "New Java Class" wizard that we're currently hacking. Then, there's the actual GUI code. I believe that, with the "constructor" code extracted from the GUI, the GUI code will become _very_ simple. Right now, we're hiding stuff, and accessing fields that we're not displaying, etc. This is a recipe for disaster: when/if JDT changes the internal code that their wizard uses, our code will break. This is not good. I'm inclined to close this bug as WONTFIX in favour of a new bug that proposes the creation of a replacement wizard. I'm also interested in some out-of-the-box thinking about how we can change this wizard into something better/more useful.
I've opened Bug 300275 to create a "Java Class Constructor" class.
This bug has been FIXED as a result of work done on Bug 300275 and Bug 300672. Marking as FIXED.