A detour from a detour from a detour (or how a graphical viewing framework for Eclipse was born)

In the context of providing class diagram visualization for TextUML Toolkit, I have developed a simple graphical viewing framework for Eclipse. It is content type based, and allows you to view anything a content provider has been registered for. For instance, any image file supported by SWT:

Graphical viewer showing image files

But you can also view the graphical representation of a Graphviz DOT file, and it will even update as you edit the file:

Graphical viewer showing DOT files

And finally, and also the reason why I had to develop support for DOT visualization in the first place, you can also visualize a UML model (here showing a model created using the TextUML Toolkit):

Graphical viewer showing UML model

All these features (except for the TextUML Toolkit itself) are part of the EclipseGraphviz project, which is open source (EPL). No releases yet as this is still very new, but you can grab the source from the Subversion repository. If you would like to contribute to the EclipseGraphviz project, or to the graphical viewing framework, your help will be most welcome.


Email this to someoneShare on FacebookShare on LinkedInShare on Google+Tweet about this on Twitter

5 thoughts on “A detour from a detour from a detour (or how a graphical viewing framework for Eclipse was born)

  1. Neil

    August 23, 2007 at 8:29pm

    Could you elaborate on the content-type registry? I have checked the code out and run it successfully in Eclipse 3.3. However I can’t see how to get the display to work. I see content-types in the preferences pane, but not how to assign this plugin as an editor.

    Do I need a Graphviz install?

  2. rchaves

    August 23, 2007 at 11:16pm

    Hi Neil,

    Thanks for your interest. This is really, really in the early stages, so be ready for a bumpy ride. For instance, there is a lot of ‘logging’ in the form of stack traces that are just dumped to the console. Also, AFAIK, this thing has only run on my machine, so there might be lots of issues that running on a second machine would have unveiled.

    Besides the quality/maturity thing, another important thing to keep in mind is that at this point Graphviz (dot) rendering only works on Windows. As the idea is that people don’t have to install Graphviz, there must be a Graphviz native bundle fragment for each target platform. I don’t have a MacOSX or a Linux machine at hand at this time so it might take a while (or a friendly hand) before we have fragments for other platforms.

    So, for starters, are you running on Windows? If not, would you like to give a hand to make it work on your platform of choice?
    Does at least image file viewing work (png, gif, jpg)?

    Re: content types – in Eclipse, content types cannot be contributed by the user, the user can only add to the list of file names/extensions associated with a content type. The following content types are contributed by the plugins on the SVN repo and have viewers associated to them:

    - the generic image content type (extended by jpg, gif and png)
    - the dot content type
    - the UML content type

    Provided you are on Windows, you should be able to get at least the graphical formats and Graphviz DOT rendering working. For the UML rendering support, besides Eclipse 3.3, you would need EMF 2.3 and UML2 2.1.

    I really appreciate your interest. One might feel I should not be making the code available if it is still so raw, but my intention is exactly to get others involved as early as possible. Please, feel free to report bugs or enter feature requests on SourceForge.
    If you feel like helping with code, even better!

  3. Neil

    August 28, 2007 at 7:36pm

    For some reason I can’t get the plugin to initialize. I have the latest source from SVN, and the plugins are present in the runtime registry, but double-clicking a jpg or .dot file in the resource navigator just launches the text editor or a system viewer. I can’t see how to force the plugin to handle it. Clearly something isn’t being registered properly. I’m on Windows, using Eclipse Europa (3.3).

    Nothing shows up in the Error log either. The only issue I have is that when I try to checkout com.abstratt.settings, the following error occurs: “Must specify a URI scheme:WORKSPACE_ROOT/com.abstratt.settings/.settings”. But I don’t think this project is necessary anyway.

    This is a neat project, I’d like to give it a shot. We’re interested in converting our custom domain-specific language into DOT to visualize our graphs. The on-the-fly editing is really appealing.

  4. rchaves

    August 28, 2007 at 8:15pm

    Hi Neil,

    I think I understand what is going on now.

    The image viewer is a view, not an editor. Instead of double-clicking the file, you should be able to open it by going Window > Show View > Other… > Other > Image Viewer.

    Now that you have the view open, you should be able to see the images by navigating the files on the package explorer, resource navigator or project explorer. Also, there is no special editor for DOT – the Eclipse basic text editor should do it for now.

    I committed last night a fix to a bug that prevented Graphviz from working as a deployed plug-in, but if you are running from the source you should not be affected by that problem anyway. Another recent fix made the image viewer aware of files opened in an editor (before it only worked for files selected in one of the views I mentioned above). I should start versioning the repository and making an update site sometime in the near future.

    About the issue with the com.abstratt.settings project, that should go away if you defined a path variable named WORKSPACE_ROOT pointing to your workspace directory (Window > Preferences… > General > Workspace > Linked resources > New…).

    Let me know if that works for you. Thanks a lot for trying the tool and providing feedback!


  5. Neil

    August 29, 2007 at 8:47am

    Aha! Thanks, it’s working now.

Comments are closed.