Bug 165362 - Switching from and then back to task editor should preserve focus
Summary: Switching from and then back to task editor should preserve focus
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 1.0.1   Edit
Assignee: Mik Kersten CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks: 166088
  Show dependency tree
 
Reported: 2006-11-21 14:20 EST by Eugene Kuleshov CLA
Modified: 2006-12-22 16:42 EST (History)
2 users (show)

See Also:


Attachments
mylar/context/zip (3.22 KB, application/octet-stream)
2006-12-22 15:58 EST, Mik Kersten CLA
no flags Details
mylar/context/zip (4.38 KB, application/octet-stream)
2006-12-22 16:42 EST, Mik Kersten CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Kuleshov CLA 2006-11-21 14:20:25 EST
Switching from and then back to task editor should preserve focus. For example if you've been entering a comment and then switched to other editor or view (Ctrl-F6, etc) and back to task editor you should stay in the same entry field as before switching.
Comment 1 Willian Mitsuda CLA 2006-11-21 15:43:09 EST
+1, this bugs me too.
Comment 2 Eugene Kuleshov CLA 2006-12-22 14:12:24 EST
It must have something to do with the focus handler. I just noticed that if you switch of the editor to some view (even using mouse), then click back anywhere in the editor area, editor jumps to the top.
Comment 3 Mik Kersten CLA 2006-12-22 15:58:53 EST
This is problematic so I went ahead and investigated for 1.0.1.  I ended up removing the following method from TaskEditor, which appeared to be doing some bugus focusing:

	@Override
	public void setFocus() {
		if (this.getActivePage() > -1 && this.getActivePage() != browserPageIndex) {
			IFormPage page = this.getPages()[this.getActivePage()];
			if (page != null) {
				page.setFocus();
			}
		} else if(this.getActivePage() == browserPageIndex && webBrowser != null) {
			webBrowser.setFocus();
		}
	}
	
So we no longer override focusing and the problem is gone.  I am not certain whether this was a work-around to some other problem, so if you guys could update to the dev build that I'm about to post, and put some mileage on this that would be helpful.
Comment 4 Mik Kersten CLA 2006-12-22 15:58:55 EST
Created attachment 56107 [details]
mylar/context/zip
Comment 5 Eugene Kuleshov CLA 2006-12-22 16:06:22 EST
Willian complained about some focus issues in task editor just few days ago and Rob said that this focus method was needed to work around focus on summary upon new task construction. See comments in bug 166088.
Comment 6 Eugene Kuleshov CLA 2006-12-22 16:08:10 EST
Oh, by the way, Mik, you should use Team -> Show Annotations action. It would of brought you to bug 166088. :-)
Comment 7 Mik Kersten CLA 2006-12-22 16:42:23 EST
Thanks for the pointer (and the tip) Eugene.  That could have been an annoying regression.  I have fixed this by keeping the work-around focusing code removed out of the TaskEditor, but adding a setFocusOfActivePage() method that's called when a new task is created.

Tested for creating new local tasks and for ensuring focus doesn't jump to top when task editor is brought to the top.
Comment 8 Mik Kersten CLA 2006-12-22 16:42:26 EST
Created attachment 56108 [details]
mylar/context/zip