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
Hi,

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

The following code [1] is working from resource from localhistory ( org.eclipse.team.internal.ui.history.FileRevisionTypedElement ) 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.



Regards,

Stéphane


[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: Tue Sep 24 02:37:01 GMT 2024

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

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

Back to the top