DESCRIPTION

Fix focus restoration in CommitEditor pages

FormPage by default re-sets the focus to the first child of the
managed form. In the CommitEditorPage, this is not convenient;
it'll always set focus on the author indication. Add focus tracking
to identify the control currently having the focus so that it can
be re-focused when the page becomes active again after a page
change or editor de-activation.

Bug: 509486
Change-Id: I678bdfde9105d04669a42ad81502eb1064c470bc
Signed-off-by: Alayna Houston xxx@xxx.xxx

COMMENTS

author: Alayna Houston
date: 2016-12-20 12:18:31.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-12-20 12:18:37.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/9402/

-------------------------------------
author: Brenden Conley
date: 2016-12-20 12:43:49.000000000

Patch Set 1: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/9402/ : UNSTABLE

-------------------------------------
author: Brenden Conley
date: 2016-12-20 13:07:53.000000000

Patch Set 1: -Code-Review

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/9404/

-------------------------------------
author: Brenden Conley
date: 2016-12-20 13:32:12.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/9404/ : SUCCESS

-------------------------------------
author: Dashawn Dalton
date: 2016-12-20 14:24:38.000000000

Patch Set 1: Code-Review-1

(4 comments)

The initial focus is still not set when I open a new commit viewer.

Only some editor fields retain the focus. Click into the commit id and then use the Tab key to see all the fields that can get focus.

Line:448, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java -> textContent.getTextWidget() is already guaranteed to be != null on line 441

Line:463, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java -> This null check is unnecessary, the control is always != null.

Line:499, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitEditorPage.java -> unnecessary (same as above)

Line:105, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/StashEditorPage.java -> unnecessary null check

-------------------------------------
author: Dashawn Dalton
date: 2016-12-20 15:00:02.000000000

Patch Set 1:

(1 comment)

> The initial focus is still not set

That's bug 378799. Here's a workaround:

Line:112, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/FocusTrackingFormPage.java -> ManagedForm#setFocus() is broken, see https://bugs.eclipse.org/378799

I'll fix that for Eclipse 4.7M5, but EGit better sets the focus explicitly like this:

	getManagedForm().getForm().setFocus();

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-12-22 22:17:07.000000000

Change has been successfully merged into the git repository by Douglas Trujillo

-------------------------------------
