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

Bug 259581

Summary: [Import/Export] WizardExportResourcesPage's Finish button isn't sensitive to Select/Deselect All
Product: [Eclipse Project] Platform Reporter: Philippe Coucaud <phil_fj12>
Component: UIAssignee: Prakash Rangaraj <prakash>
Status: VERIFIED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: makandre, pwebster
Version: 3.5   
Target Milestone: 3.7 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 327138    
Attachments:
Description Flags
Patch v01 none

Description Philippe Coucaud CLA 2008-12-23 11:54:13 EST
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 Andrew Mak CLA 2009-08-17 15:23:41 EDT
Hi,

I'm encountering this problem too in a slightly different scenario.

In my case, I start off with nothing selected in workspace, then I go to File > Export > General > Archive File.  Nothing is selected in the tree viewer (as expected), while the archive file field is filled in (remembered from a previous export).  Clicking Select all at this point should enable the Finish button but it doesn't.
Comment 2 Prakash Rangaraj CLA 2010-08-02 01:12:09 EDT
Created attachment 175681 [details]
Patch v01
Comment 3 Prakash Rangaraj CLA 2010-10-04 07:16:52 EDT
Patch v01 released to HEAD
Comment 4 Prakash Rangaraj CLA 2010-10-04 13:28:57 EDT
(In reply to comment #3)
> Patch v01 released to HEAD
Comment 5 Andrew Mak CLA 2010-10-06 09:07:27 EDT
Hi, would it be possible to get this fixed in 3.6.2 as well?  Thanks.
Comment 6 Prakash Rangaraj CLA 2010-10-26 04:48:07 EDT
Verified in I20101025-1800