The source for the Eclipse Project Handbook is in AsciiDoc format (rendered using Asciidoctor via Maven), and includes embedded Graphviz graph descriptions (which are rendered into embedded images). Proofing those images is a bit of a pain: it requires that I actually build the handbook and use a browser to view the results.

A few years ago, I wrote an Image Util plug-in, primarily as an excuse to learn about how adapters work. I pulled that old plug-in into my current Eclipse IDE (Neon edition) and was quite happy to learn that it still works. The implementation is simple enough: it provides an Image Preview view that—when possible—adapts the current selection into an ImageProvider that (curiously enough) provides an image to display. It works brilliantly for file selections and I even made it work for selections in the Remote Systems Explorer.

So, frustrated with the round-trip process for testing images (after spending some quality time hunting down an existing solution), I created a plug-in that adapts an arbitrary text selection into an image provider that invokes the Graphviz dot command to render the selection into an image. I was a bit stunned when my first attempt at implementing it just worked. It works in every text editor that I’ve tested it with (including the handy AsciiDoc WikiText editor).


Anyway… it’s a quick and dirty hack (albeit, a hack with some potential) that requires the command-line tool be installed, but I think that it demonstrates some of the power that comes when your platform has well-documented and stable APIs (FWIW, the implementation has about seven meaningful lines of code).

Note that the implementation is currently only available as source code. Sorry, there’s no software site yet. Maybe that’s something we can work on at the EclipseCon Europe 2016 Hackathon!

EclipseCon Europe 2016

This entry was posted in Eclipse 101, Examples, Hackathon. Bookmark the permalink.

4 Responses to

  1. You may want to have a look at PlantUml and its Eclipse plugin for textually describing diagrams. However, I’m not sure if that really fits your use case, since I don’t really know AsciiDoc.

  2. Mark Crocker says:

    Just a few entries down from the blog bot posting of this article on the Eclipse Mattermost News channel is a related bot posting, you and the readers of this blog may find interesting:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s