DESCRIPTION

Added adapters to IURIEditorInput to better support external files

If we can't get IResource adapter from current editor, IURIEditorInput
is our last resort. It is implemented by FileStoreEditorInput which is
used by Eclipse for editing files which are located outside workspace.

If the URI returned by the IURIEditorInput represents a valid file path,
we can check if we have a repository for this path even if it is not in
the workspace.

Added adapters from IURIEditorInput to java.io.File, Repository and
IHistoryPageSource and updated Repository, Staging and History views so
that they can show their specific content for active external editor.

Change-Id: Ibf582b84b7a8c75662e2ccdfd6453fd1da1876b1
Signed-off-by: Jayvion Booth xxx@xxx.xxx


COMMENTS

author: Jayvion Booth
date: 2015-11-14 16:39:43.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2015-11-14 16:48:31.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2015-11-14 17:12:50.000000000

Patch Set 1: Verified+1

Build Successful 

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

-------------------------------------
author: Alayna Houston
date: 2015-11-14 17:53:59.000000000

Patch Set 1:

While I see what this does code-wise, could you describe what this changes UI-wise? What works now that didn't work before?

-------------------------------------
author: Jayvion Booth
date: 2015-11-14 19:08:35.000000000

Patch Set 1:

> While I see what this does code-wise, could you describe what this
 > changes UI-wise? What works now that didn't work before?

Make History/Repositories/Staging view "link" to selection.

From the git repositories view open a file in the editor which is not in the workspace. The 3 Git views above will now show the appropriate content if you alternatively activates the "external" editor or select a  project in the packages explorer from a different repository.

Without the change, activating the editor doesn't change the content to the right repository in the Git views.

-------------------------------------
author: Alayna Houston
date: 2015-11-14 20:46:29.000000000

Patch Set 1:

> Without the change, activating the editor doesn't change the
 > content to the right repository in the Git views.

History view works.

Git staging view doesn't update if I edit a file from a closed project, make some change, and save. Not sure if that was supposed to be fixed by this.

I don't see any changes in the git repositories view.

-------------------------------------
author: Alayna Houston
date: 2015-11-14 20:51:10.000000000

Patch Set 1:

> Git staging view doesn't update if I edit a file from a closed
 > project, make some change, and save. Not sure if that was supposed
 > to be fixed by this.

Git staging view also doesn't show the unstaged change if after the modification, I close the editor, select a different repo X in the git repositories view, then again open the editor (from the git repositories view) on that previously changed file. The staging view does update: the staged/unstaged changes from repo X vanish, but but the new unstaged change in the file just opened doesn't appear in the staging view. So it looks as if that problem is due again to there no IResourceChangeEvent being triggered, and thus the IndexDiffCache isn't updated.

-------------------------------------
author: Jayvion Booth
date: 2015-11-14 20:57:36.000000000

Patch Set 1:

> > Git staging view doesn't update if I edit a file from a closed
 > > project, make some change, and save. Not sure if that was
 > supposed
 > > to be fixed by this.
 > 
 > Git staging view also doesn't show the unstaged change if after the
 > modification, I close the editor, select a different repo X in the
 > git repositories view, then again open the editor (from the git
 > repositories view) on that previously changed file. The staging
 > view does update: the staged/unstaged changes from repo X vanish,
 > but but the new unstaged change in the file just opened doesn't
 > appear in the staging view. So it looks as if that problem is due
 > again to there no IResourceChangeEvent being triggered, and thus
 > the IndexDiffCache isn't updated.

Thomas, this patch is not about updating any view state if a file modification state changes, it is about to *link* the view to the file/repository if the view is in "linked" mode, and to enable "Show In -> <view>" to work with the external file input if the view is not in "linked" mode.

I've tested and it works fine with Repository, History and Staging view (later of course only if it knows that file is changed).

-------------------------------------
author: Alayna Houston
date: 2015-11-14 21:02:55.000000000

Patch Set 1: Code-Review+1

Ok. The linking appears to work.

-------------------------------------
author: Jayvion Booth
date: 2015-11-14 21:25:01.000000000

Patch Set 1: Code-Review+2

-------------------------------------
author: Gerrit Johnathan Pham
date: 2015-11-14 21:25:08.000000000

Change has been successfully merged into the git repository by Jayvion Booth

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