Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368492

Summary: Finish button not disabled when no entries selected
Product: [WebTools] WTP ServerTools Reporter: Kaitlin Duck Sherwood <kate.sherwood>
Component: wst.serverAssignee: Steven Hung <sghung>
Status: RESOLVED FIXED QA Contact: Elson Yuen <eyuen7>
Severity: trivial    
Priority: P3 CC: cbridgha
Version: unspecifiedFlags: eyuen7: pmc_approved? (david_williams)
eyuen7: pmc_approved? (raghunathan.srinivasan)
eyuen7: pmc_approved? (naci.dai)
eyuen7: pmc_approved? (neil.hauge)
eyuen7: pmc_approved? (kaloyan)
cbridgha: pmc_approved+
eyuen7: review+
Target Milestone: 3.4.1   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
See Also: https://git.eclipse.org/r/109120
Whiteboard: pmc_approved
Bug Depends on:    
Bug Blocks: 390692, 390693    
Attachments:
Description Flags
Patch v1.0 eyuen7: iplog+, eyuen7: review+

Description Kaitlin Duck Sherwood CLA 2012-01-12 17:12:43 EST
Build Identifier: 20110916-0149

In the New Server Runtime Environment dialog, which you get to via the server preferences dialog, even if you have no server selected, the Finish button is enabled.

Clicking the Finish button *appears* to not do anything (like Cancel), but it is misleading to have it appear to agree to do something.  I expected it to be disabled until I selected an entry.

Reproducible: Always

Steps to Reproduce:
1. Eclipse->Preferences->Server->Runtime Preferences
2. Add
3. Type gibberish into the RuntimeTypeComposite box (which says "type filter text")

The finish button is enabled.
Comment 1 Steven Hung CLA 2012-06-06 13:57:29 EDT
Created attachment 216956 [details]
Patch v1.0

The NewRuntimeWizardFragment did not override the isComplete method. As a result, even when nothing was selected or something invalid was selected, the wizard always had the "Finish" button enabled. The fix ensures the isComplete method is implemented and checks for a valid selected runtime.

1. Create different runtimes to ensure that the wizard shows the "Next" and "Finish" buttons correctly. Created Apache Tomcat v6.0, Apache Tomcat v7.0, HTTP Preview, J2EE Preview, and J2EE Runtime Library runtimes and ensured that the "Next" and "Finish" buttons were enabled properly
2. Tested selecting an invalid runtime, such as the folder "Apache" or "Basic". Ensured that the "Finish" button is not enabled as it was before the fix
3. Tested adding gibberish into the filter text, such as "asdf" or "" (empty string). Ensured that the "Finish" button is not enabled as it was before the fix
4. A runtime from another non-WTP adapter
Comment 2 Elson Yuen CLA 2012-08-21 12:26:34 EDT
Patch looks good.  Thanks for submitting the patch.
Comment 3 Elson Yuen CLA 2012-08-21 13:21:09 EDT
Code released to 3.5
Comment 4 Steven Hung CLA 2012-08-21 16:51:19 EDT
WTP 3.4.1 PMC candidate

* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such.
This issue is not a stop-ship defect, but it is a usability issue, since it fails silently when the user clicks finish and it can be confusing that the finish button is enabled when an invalid runtime is selected.

* Is there a work-around? If so, why do you believe the work-around is insufficient?
There is no workaround, because the wizard's validation should be preventing the user from selecting invalid runtimes and finishing the wizard.

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?
1. Create different runtimes to ensure that the wizard shows the "Next" and "Finish" buttons correctly. Created Apache Tomcat v6.0, Apache Tomcat v7.0, HTTP Preview, J2EE Preview, and J2EE Runtime Library runtimes and ensured that the "Next" and "Finish" buttons were enabled properly
2. Tested selecting an invalid runtime, such as the folder "Apache" or "Basic". Ensured that the "Finish" button is not enabled as it was before the fix
3. Tested adding gibberish into the filter text, such as "asdf" or "" (empty string). Ensured that the "Finish" button is not enabled as it was before the fix
4. A runtime from another non-WTP adapter

* Give a brief technical overview. Who has reviewed this fix?
The NewRuntimeWizardFragment did not override the isComplete method. As a result, even when nothing was selected or something invalid was selected, the wizard always had the "Finish" button enabled. The fix ensures the isComplete method is implemented and checks for a valid selected runtime.

The fix has been reviewed by Elson Yuen.

* What is the risk associated with this fix?
Low, since validation has been added to prevent the user from finishing the new runtime wizard when an invalid runtime is selected.
Comment 5 Chuck Bridgham CLA 2012-08-21 16:59:09 EDT
thanks approved
Comment 6 Elson Yuen CLA 2012-08-23 10:31:15 EDT
Code released to 3.4.1
Comment 7 Eclipse Genie CLA 2017-10-11 16:38:34 EDT
New Gerrit change created: https://git.eclipse.org/r/109120