Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » [API] getting IFileRevision from ResourceEditableRevision
[API] getting IFileRevision from ResourceEditableRevision [message #1385077] Wed, 04 June 2014 08:41
Stephane Bouchet is currently offline Stephane BouchetFriend
Messages: 280
Registered: July 2009
Senior Member

i'm using the Eclipse API to get an IFileRevision from various resources.

The following code [1] is working from resource from localhistory ( ) but not for ResourceEditableRevision ( org.eclipse.egit.ui.internal.ResourceEditableRevision ).

I can of course directly cast the object to ResourceEditableRevision , but in that case i got a discouraged access warning.



[1] :
if (entrypoint instanceof IAdaptable) {
    IAdaptable adaptable=(IAdaptable)entrypoint;
    ISharedDocumentAdapter adapter=(ISharedDocumentAdapter)adaptable.getAdapter(ISharedDocumentAdapter.class);
    if (adapter != null) {
      IEditorInput input=adapter.getDocumentKey(entrypoint);
       if (input != null)
        return (IFileRevision)input.getAdapter(IFileRevision.class);
Previous Topic:Error when pushing
Next Topic:Jgit Servlet
Goto Forum:

Current Time: Wed May 27 10:28:03 GMT 2020

Powered by FUDForum. Page generated in 0.06103 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top