Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » [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: 261
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: Fri Nov 28 19:48:39 GMT 2014

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

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