Bug 433295 - [move method] 'OK' button not disabled if user un-check all the movable items in preview page
Summary: [move method] 'OK' button not disabled if user un-check all the movable items...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-23 08:42 EDT by valmiki jansi CLA
Modified: 2022-10-16 15:19 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description valmiki jansi CLA 2014-04-23 08:42:33 EDT
Hi,

I am using ltk framework for providing Refactoring feature to my IDE. There after reaching the preview page if the user unchecked all the items which are supposed to move : still the finish button is enabled; so on clicking of finish move does not happen as none of the objects were selected to move.Actually the finish button should be disabled in such case.

The PreviewWizardPage class has createSelectionChangedListener() method which adds a selection change listener to the page, but here they are not disabling the finish button and that method is private so I am not able to do it from my end.

Thanks & Regards,
Jansi
Comment 1 Noopur Gupta CLA 2014-04-23 09:08:45 EDT
Do you mean the 'OK' button in preview page?
Please provide an example code to reproduce it.
And if possible, you can also provide a patch for the fix.
Comment 2 valmiki jansi CLA 2014-04-30 00:37:39 EDT
In the PreviewWizardPage class method I have added the comment where I feel would help to fix this :

private ISelectionChangedListener createSelectionChangedListener() {
		return new ISelectionChangedListener(){
			public void selectionChanged(SelectionChangedEvent event) {
				IStructuredSelection sel= (IStructuredSelection) event.getSelection();
				if (sel.size() == 1) {
					PreviewNode newSelection= (PreviewNode)sel.getFirstElement();
					if (newSelection != fCurrentSelection) {
						fCurrentSelection= newSelection;
						showPreview(newSelection);
					}
				} else {
					showPreview(null);
                                      
/* here if the selected elements size is '0' then the finish button should be disabled */

				}
			}
		};
	}

If I am able to fix it I would add the code for that and update you.

Thanks & Regards,
Jansi
Comment 3 Martin Mathew CLA 2014-05-01 22:53:41 EDT
(In reply to valmiki jansi from comment #2)
>                                       
> /* here if the selected elements size is '0' then the finish button should
> be disabled */
The variable 'sel' will not contain only the checked items from the tree viewer, hence the proposed fix will not solve the issue.
fTreeViewer.getCheckedElements() has the list of checked items.
Comment 4 Eclipse Genie CLA 2020-08-17 07:41:16 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.

--
The automated Eclipse Genie.
Comment 5 Eclipse Genie CLA 2022-10-16 15:19:20 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.

--
The automated Eclipse Genie.