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

Bug 358724

Summary: When processing arrows to traverse month, don't close popup when done scrolling
Product: z_Archived Reporter: Sharon Snyder <sharonbsnyder>
Component: NebulaAssignee: Emil Crumhorn <emil.crumhorn>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch for mouse click processing of arrow buttons on month bar (and includes key processing fix from previously submitted patch) wim.jongman: iplog+

Description Sharon Snyder CLA 2011-09-23 10:08:11 EDT
Build Identifier: 

I did not find it intuitive that the popup would close when you click on the month arrows.  I have fixed this so that if the arrowThread was running when the mouseUp event is received, we will not close the popup.  This happens if you have a date selected (which was most likely from before you clicked on the arrow).

Reproducible: Always

Steps to Reproduce:
1.drop down the combo to show the calendar
2.click on the arrow key (either direction)
3.upon mouse up, popup closes (if you had a previously selected date)
Comment 1 Sharon Snyder CLA 2011-09-23 10:11:26 EDT
Created attachment 203906 [details]
patch for mouse click processing of arrow buttons on month bar (and includes key processing fix from previously submitted patch)
Comment 2 Sharon Snyder CLA 2011-09-23 10:12:22 EDT
Code to just fix the mouse processing is below.  From CalendarComposite.java:


	public void mouseUp(MouseEvent event) {
		mMouseIsDown = false;
		boolean bArrowThread = (mArrowThread!=null);
		killArrowThread();

		if (mNoDayClicked) {
			mNoDayClicked = false;
			return;
		}

		if (mDateRange) {
			// this may seem odd but it's not. First we set the "up" date to the
			// current date
			// then we overwrite it by setting the selected date to when the
			// mouse click was "down".
			// that way the date set on the combo will be the date the user
			// clicked first, and not the date when the user
			// let go of the mouse button, this will be reflected in the
			// listeners as well
			mMouseUpDay = mSelectedDay;
			mSelectedDay = mMouseDownDay;
		}

		//don't close the popup if they were pressing the arrow!
		if (mSelectedDay != null && !bArrowThread) {
			notifyListeners();
			notifyClose();
		}
	}
Comment 3 Emil Crumhorn CLA 2011-09-24 11:39:17 EDT
Patch applies, thanks!!