Added adapters to IURIEditorInput to better support external files
commit4ada21891462a119bbd05fb78d48b6dd60079930
authorAndrey Loskutov <loskutov@gmx.de>
Sat, 14 Nov 2015 16:39:23 +0000 (14 17:39 +0100)
committerAndrey Loskutov <loskutov@gmx.de>
Sat, 14 Nov 2015 16:39:23 +0000 (14 17:39 +0100)
treecea85517d82a7d513659d942eed34984b9344906
parentd6c0b6c0d7770115e412d9980868128e32e95b94
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: Andrey Loskutov <loskutov@gmx.de>
org.eclipse.egit.core/src/org/eclipse/egit/core/AdapterUtils.java
org.eclipse.egit.ui/plugin.xml
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CommonUtils.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/factories/GitAdapterFactory.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/GitHistoryPage.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesView.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java