Bug 174308 - New Servlet should be on JDT class dropdown
Summary: New Servlet should be on JDT class dropdown
Status: CLOSED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.servlet (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.0 M4   Edit
Assignee: Kaloyan Raev CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2007-02-15 09:44 EST by Tim deBoer CLA
Modified: 2008-05-12 09:10 EDT (History)
1 user (show)

See Also:


Attachments
patch (33.43 KB, patch)
2007-12-10 07:18 EST, Kaloyan Raev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim deBoer CLA 2007-02-15 09:44:41 EST
In the Java perspective there is a JDT toolbar that has buttons for creating a new Java project, package, or class. Beside the class button there is a dropdown that lets you create a new class, interface, enum, etc. This should be extended by WTP to add the option for a new servlet.
Comment 1 Kaloyan Raev CLA 2007-10-19 13:25:40 EDT
Tim, 

Do you mean that we need to extend the toolbar in the Java perspective?
Or you mean that we need a similar toolbar in the Java EE perspective that include the Servlet wizard?

If we contribute new action items to the Java perspective toolbar, then with the same logic we may add all other Java EE artifacts in addition to the Servlet. In this case we may overcrowd the Java perspective with Java EE content.
Comment 2 Tim deBoer CLA 2007-10-19 13:52:20 EDT
I agree, adding all of the EE5 artifacts to the existing menu could be a bit much. I use the regular drop down to create all my Java classes, so I really just want to do the same thing for Java EE.

Right now we have 5 separate buttons on the JEE perspective toolbar (one for each project type). Ideally I think we'd just have two drop downs - one for 'projects' (EAR, EJB, Web, App Client, Connector) and one for 'artifacts' (Servlet, EJB, JPA, JSP, etc.).
Comment 3 Kaloyan Raev CLA 2007-11-08 10:25:15 EST
I think I can do this for M4. 
Comment 4 Kaloyan Raev CLA 2007-12-10 07:18:17 EST
Created attachment 84854 [details]
patch

This patch removes the old five toolbar buttons for creating Java EE projects and replaces them with two pulldown toolbar buttons:
  - for creating Java EE projects: Web, EJB, EAR, etc.
  - for creating Java EE artifacts: Servlet, Listeners, XDoclet beans, etc. 

This patch covers only the JavaEE and EJB components, because I am a committer only for them. Other projects and artifacts like JPA project, JSP, Web Services, etc. should be added to the pulldown buttons by the respective committers. I will inform them how to do this on the mailing list.
Comment 5 Kaloyan Raev CLA 2007-12-10 07:25:24 EST
Dropped to HEAD. 
Comment 6 Chuck Bridgham CLA 2007-12-10 17:15:29 EST
I just checked this out, and I like the idea, but I have a couple suggestions.

We need to be similar to other multiple action buttons, like Run and Debug.
They have separate hover text, and icons defining the group of actions.

And they all have "launch history" to capture the last action taken (which is the default action if the button is selected rather than expanded.

Right now the first action defined "Dynamic Web Project" is selected.

Also - The Category names should be Named "Create Java EE Project"  and "Create Java EE Artifact" - because the "Create" verb isn't currently included in the titles of these actions.
Comment 7 Kaloyan Raev CLA 2007-12-11 05:34:09 EST
Chuck, thanks for the suggestions. 

I have made the Java EE Projects and Java EE Artifacts pulldown buttons similar not to the Run/Debug buttons, but to the Java class artifacts in the Java (JDT) perspective. 

I have selected Dynamic Web Project and Servlet wizard to be default, because it is in my opinion the first action that the user would use. 

I like the idea of having "launch history" and dynamically change the default action of the pulldown buttons. Unfortunately, it seems that the technology of the pulldown button does not allow changing the default icon - we have to make new generic icons for "Create Java EE Project" and "Create Java EE Artifact". It should be possible to change the tooltip text dynamically. Currently, the Java EE pulldown button have the same behavior of the Java class (JDT) pulldown button - there the default action is fixed to "New Java Class". 

About the action titles - I haven't touched them. If I put "Create" prefix in the action titles, then this will be also reflected in the File > New submenus, which is undesired effect. Again, check the Java class pulldown in the JDT perspective - there is no "Create" verb in the action titles.  
Comment 8 Kaloyan Raev CLA 2007-12-27 12:38:11 EST
Verified with the S-3.0M4-20071227065330 build. 
Comment 9 Kaloyan Raev CLA 2008-05-12 09:10:50 EDT
Closing