Bug 189210 - CVS's editor input should implement IURIEditorInput.
Summary: CVS's editor input should implement IURIEditorInput.
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: platform-cvs-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 197015
Blocks:
  Show dependency tree
 
Reported: 2007-05-25 15:49 EDT by Ed Merks CLA
Modified: 2019-09-06 15:34 EDT (History)
3 users (show)

See Also:


Attachments
Patch that adds IURIEditorInput when a URI is available (6.30 KB, patch)
2007-09-11 14:54 EDT, Michael Valenta CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Merks CLA 2007-05-25 15:49:58 EDT
 
Comment 1 Michael Valenta CLA 2007-07-18 14:37:14 EDT
Fix released to HEAD
Comment 2 Michael Valenta CLA 2007-07-18 15:10:34 EDT
I need to back out of this temporarily. Although the spec says that null can be returned the TextFileDocumentProvider doesn't behave well when it is.
Comment 3 Michael Valenta CLA 2007-09-11 14:54:07 EDT
Created attachment 78099 [details]
Patch that adds IURIEditorInput when a URI is available

I've attached a patch with the fix for this. I want to hold off on releasing it until after M2 because making an editor input implement IURIEditorInput changes a significant number of interactions between the input, the editor and the document provider.
Comment 4 Michael Valenta CLA 2007-09-11 15:14:48 EDT
One scenario that seems to have degraded performance is opening a Compare Editor after a restart.
Comment 5 Michael Valenta CLA 2007-10-26 10:36:03 EDT
I'm not sure if we'll have the cycles to address this in 3.4.
Comment 6 Szymon Brandys CLA 2008-05-09 04:23:32 EDT
Mass update - removing 3.4 target. This was one of the bugs marked for
investigation (and potential fixing) in 3.4 but we ran out of time. Please ping
on the bug if fixing it would be really important for 3.4, and does not require
API changes or feature work.
Comment 7 Ed Merks CLA 2008-05-09 06:53:12 EDT
We've had to write a whack of reflective code like this to avoid even visible optional dependencies on CVS to be able to view CVS-based resources.


    static final Class<?> FILE_REVISION_CLASS;
    static final Method FILE_REVISION_GET_URI_METHOD;
    static 
    {
      Class<?> fileRevisionClass = null;
      Method fileRevisionGetURIMethod = null;
      Bundle bundle = Platform.getBundle("org.eclipse.team.core");
      if (bundle != null && (bundle.getState() & (Bundle.ACTIVE | Bundle.STARTING | Bundle.RESOLVED)) != 0)
      {
        try
        {
          fileRevisionClass = bundle.loadClass("org.eclipse.team.core.history.IFileRevision");
          fileRevisionGetURIMethod = fileRevisionClass.getMethod("getURI");
        }
        catch (Throwable exeption)
        {
          // Ignore any exceptions and assume the class isn't available.
        }
      }
      FILE_REVISION_CLASS = fileRevisionClass;
      FILE_REVISION_GET_URI_METHOD = fileRevisionGetURIMethod;
    }

    public static URI getURI(IEditorInput editorInput)
    {
      if (FILE_REVISION_CLASS != null)
      {
        Object fileRevision = editorInput.getAdapter(FILE_REVISION_CLASS);
        if (fileRevision != null)
        {
          try
          {
            return URI.createURI(((java.net.URI)FILE_REVISION_GET_URI_METHOD.invoke(fileRevision)).toString());
          }
          catch (Throwable exception)
          {
            EMFEditUIPlugin.INSTANCE.log(exception);
          }
        }

But given that we have this, we can get by quite nicely. 
Comment 8 Eclipse Webmaster CLA 2019-09-06 15:34:45 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.