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

Bug 327138

Summary: [Import/Export] WizardExportResourcesPage's Finish button isn't sensitive to Select/Deselect All
Product: [Eclipse Project] Platform Reporter: Prakash Rangaraj <prakash>
Component: UIAssignee: Prakash Rangaraj <prakash>
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: bokowski, makandre, phil_fj12, pwebster
Version: 3.6   
Target Milestone: 3.6.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on: 259581    
Bug Blocks:    

Description Prakash Rangaraj CLA 2010-10-06 12:57:18 EDT
+++ This bug was initially created as a clone of Bug #259581 +++

Build ID: I20081211-1908

1. Select a file in a project, then select Export > General / Archive File, and press Next : the selected file is checked in the tree viewer and the Finish button is disabled.
2. Enter the name of the output file: Finish button becomes enabled
3. Uncheck the selected file: Finish button becomes disabled and an error is generated (no resources selected to export).
4. Recheck the file to export: Finish button is enabled again. So far so good.
5. Press Deselect All: selected file properly gets unchecked but the Finish button remains enabled and no error is displayed.
6. Press Finish and you get an error: Zip file must have at least one entry.


The reason for the inconsistent state at step 5 is because WizardExportResourcesPage.updateWidgetEnablements() is only called at initialization and when a CheckStateChangedEvent is triggered in the TreeViewer. However, Select All, Deselect All and Filter Types ... buttons do manipulate the tree viewer's state without triggering any CheckStateChangedEvent.

WizardFileSystemResourceImportPage1 properly handles a similar scenario by explicitly calling updateWidgetEnablements() on selection events from both the Select All and Deselect All buttons:

[...]
        listener = new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                setAllSelections(true);
                updateWidgetEnablements();
            }
        };
        selectAllButton.addSelectionListener(listener);
[...]

whereas WizardExportResourcesPage only modifies the tree viewer:

[...]
        listener = new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
                resourceGroup.setAllSelections(true);
            }
        };
        selectButton.addSelectionListener(listener);
[...]
Comment 1 Prakash Rangaraj CLA 2010-10-06 12:57:55 EDT
Bug cloned for backporting to 3.6.2
Comment 2 Boris Bokowski CLA 2010-11-22 11:05:50 EST
+1 for 3.6.2
Comment 3 Prakash Rangaraj CLA 2010-11-23 05:01:58 EST
Patch v01 from the original bug, released to R3_6_maintenance branch