Bug 209565 - [Dialogs] The OK button in ContainerSelectionDialog should be disabled if no project is available
Summary: [Dialogs] The OK button in ContainerSelectionDialog should be disabled if no ...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2007-11-12 17:27 EST by Ling Hao CLA
Modified: 2019-09-06 16:19 EDT (History)
1 user (show)

See Also:


Attachments
Patch to disable the 'OK' button if there are no containers to select. (4.11 KB, patch)
2008-01-20 14:51 EST, Remy Suen CLA
no flags Details | Diff
Corrected patch that compiles properly. (4.11 KB, patch)
2008-02-06 16:09 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ling Hao CLA 2007-11-12 17:27:16 EST
Build ID: M20070212-1330

Steps To Reproduce:
1. Go to an empty workspace
2. Open an editor (not associated with a project)
3. new ContainerSelectionDialog(...) since there are no projects available, the OK button should be disabled.


More information:
Comment 1 Remy Suen CLA 2007-11-16 18:04:44 EST
(In reply to comment #0)
> 2. Open an editor (not associated with a project)
> 3. new ContainerSelectionDialog(...) since there are no projects available, the
> OK button should be disabled.

I don't fully understand these two steps. How are you opening an editor? Through File > Open...? That just opens a file in Eclipse, no dialog appears except for the operating system's file selection dialog.
Comment 2 Susan McCourt CLA 2008-01-16 14:44:58 EST
I believe this goes to Tod as an IDE/Dialog bug.
Comment 3 Remy Suen CLA 2008-01-20 14:51:38 EST
Created attachment 87361 [details]
Patch to disable the 'OK' button if there are no containers to select.
Comment 4 Tod Creasey CLA 2008-02-06 15:36:48 EST
This patch is out of date and needs to be refreshed to HEAD
Comment 5 Tod Creasey CLA 2008-02-06 15:56:21 EST
This patch does actually compile against HEAD but it has an error in it.

On top of that I am not sure where this case shows up - we will need better steps.
Comment 6 Remy Suen CLA 2008-02-06 16:09:48 EST
Created attachment 89060 [details]
Corrected patch that compiles properly.

(In reply to comment #5)
> On top of that I am not sure where this case shows up - we will need better
> steps.

I don't understand the scenario given by comment 0, but here is one way to get the dialog up.

1. Start Eclipse pointing at an empty/non-existent folder for the workspace.
2. File > Import > File System
3. Click the 'Browse' button.
4. See that there are no projects / folders available, but the 'OK' button is enabled.
Comment 7 Tod Creasey CLA 2008-02-12 14:04:24 EST
This should not be enabled until a selection is made. We would need to add API to ContainerSelectionGroup to listen for selection to do this fix propertly.
Comment 8 Remy Suen CLA 2008-02-14 09:10:44 EST
(In reply to comment #7)
> This should not be enabled until a selection is made. We would need to add API
> to ContainerSelectionGroup to listen for selection to do this fix propertly.

Should we be tagging this as "api" since ContainerSelectionGroup is actually an internal class? Also, the listener portion is already embedded in ContainerSelectionDialog's createDialogArea(Composite) method. I haven't debugged it through yet, but the dialog seems to be initialized with a selection right from the get-go, which I presume is causing getOkButton().setEnabled(true) to be called, thus, enabling the button if at least one project is available in the workspace.
Comment 9 Tod Creasey CLA 2008-02-14 10:20:02 EST
right you are Remy
Comment 10 Susan McCourt CLA 2009-07-09 18:21:49 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 11 Eclipse Webmaster CLA 2019-09-06 16:19:18 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.