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 04:41
Stephane Bouchet is currently offline Stephane Bouchet
Messages: 255
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: Sat Aug 23 15:27:43 EDT 2014

Powered by FUDForum. Page generated in 0.01719 seconds