Bug 225816 - [XML Catalog] The Finish button is always enabled in XML Catalog Import wizard
Summary: [XML Catalog] The Finish button is always enabled in XML Catalog Import wizard
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0 M7   Edit
Assignee: Gabriel Indik CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-04-04 15:01 EDT by Valentin Baciu CLA
Modified: 2008-04-24 00:45 EDT (History)
1 user (show)

See Also:


Attachments
Patch (3.10 KB, patch)
2008-04-21 16:50 EDT, Gabriel Indik CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Valentin Baciu CLA 2008-04-04 15:01:24 EDT
Build ID: S-3.0M6-20080404114343

Steps To Reproduce:
1. File > Import 
2. Select XML > Import XML Catalog
3. Click Next
4. Don't select anything in the tree (only projects with XML files in them will be in the tree).
5. Observe the finish button enablement

More information:
The Finish button is always enabled regardless of the selection type. For example, selecting a project or folder or nothing at all has no effect. 

In previous versions (2.0.*), it appears that the OK button in the Import dialog was only enabled when an XML file was selected. The dialog was converted to be a wizard page for 3.0. The enablement logic from the previous version should be reused.
Comment 1 Valentin Baciu CLA 2008-04-04 15:01:56 EDT
Gabriel, please try to address this for M7.
Comment 2 Gabriel Indik CLA 2008-04-21 16:50:52 EDT
Created attachment 96929 [details]
Patch

This patch resolves the issue by ensuring the wizard can only be finished if a file has been selected.
Comment 3 Valentin Baciu CLA 2008-04-21 20:45:01 EDT
Thank you Gabriel. The fix is committed to head. Nitin will release later on tonight.

I know that code's been there for a while but should there not be an associated removeSelectionChangedTreeListener to pair with org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView.addSelectionChangedTreeListener(ISelectionChangedListener)? Perhaps chat with Keith about it.
Comment 4 Gabriel Indik CLA 2008-04-22 14:15:10 EDT
(In reply to comment #3)
> Thank you Gabriel. The fix is committed to head. Nitin will release later on
> tonight.
> I know that code's been there for a while but should there not be an associated
> removeSelectionChangedTreeListener to pair with
> org.eclipse.wst.common.ui.internal.viewers.SelectSingleFileView.addSelectionChangedTreeListener(ISelectionChangedListener)?
> Perhaps chat with Keith about it.

AddListener and removeListener are not supposed to be paired. Listeners are garbage collected when a control is disposed. Explicitly removing a listener is only necesary in very specific scenarios i.e. shared widgets. I talked to Keith about this, the places where he removes listeners are special cases as the one described: shared controls in the properties view of the XSD Editor.
Comment 5 Valentin Baciu CLA 2008-04-23 12:32:06 EDT
The patch appears to have been released.
Comment 6 Valentin Baciu CLA 2008-04-23 13:37:49 EDT
Verified with I20080423080648. Closing.
Comment 7 David Williams CLA 2008-04-24 00:45:24 EDT
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword.