DESCRIPTION

Workaround to enable linking multiple resources to HistoryView

When given a selection the GenericHistoryView only considers the first
element and adapts it to an IResource before passing it on as input. To
work around this behavior the GitHistoryPage now tracks the current
selection itself and uses it as input if preferable.

Bug: 392948
Signed-off-by: Ronin Harrell xxx@xxx.xxx
Signed-off-by: Karter Mora xxx@xxx.xxx
Signed-off-by: Maleah Marks xxx@xxx.xxx
Signed-off-by: Corbin Edwards xxx@xxx.xxx
Signed-off-by: Maren Gonzales xxx@xxx.xxx
Signed-off-by: Denise Bennett xxx@xxx.xxx
Change-Id: Idd3f2434881085d90a547f825fb20ba8895b7e79

COMMENTS

author: Denise Bennett
date: 2017-04-19 13:28:24.000000000

Uploaded patch set 14.

-------------------------------------
author: Brenden Conley
date: 2017-04-19 13:28:30.000000000

Patch Set 14:

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

-------------------------------------
author: Brenden Conley
date: 2017-04-19 13:50:57.000000000

Patch Set 14: Verified+1

Build Successful 

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

-------------------------------------
author: Alayna Houston
date: 2017-04-21 08:26:03.000000000

Patch Set 14: Code-Review+1

Now it works nicely. I notice that we have different behavior in the history and in the staging view. The staging view doesn't react on multi-selections, and resets to "No repository selected" when the selection changes to an empty selection or one that doesn't translate to a repository. The GitHistoryPage does react to multi-selections and keeps whatever it currently displays when the selection becomes empty or doesn't translate to any repository.

That should be fixed in a follow-up change. Probably extract the selection tracking from the GitHistoryPage into a separate re-usable (and possibly customizeable) SelectionTracker that can then also be used in the StagingView. The implementation in GitHistoryPage is much simpler than the (old) part tracking in the StagingView.

I think this is OK to go in. Minor nit-pick: why are all the new methods in GitHistoryPage protected? They're not used anywhere else and could just as well be private.

@Matthias, could you please double-check?

-------------------------------------
author: Denise Bennett
date: 2017-04-24 07:40:40.000000000

Patch Set 14:

Hi Thomas,

Thank you very much for your very fast review! 

You are right, the behavior between the staging view and history view is now slightly different, but should probably be adapted in a separate change. Do you want to keep it in the same bug or in a new bug specific to the staging view?

I also changed the method visibility to 'private' to be in line with the other methods. I tend to make helper methods, e.g., just getting the selection, protected to be more extensible. But you are right, in this case it is not necessary since no one will subclass this class and we do not use the methods anywhere else.

Thanks again!

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