• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eclipse plugin development resources

 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just thought I'd write a little Eclipse plugin that would display a "live" graph based on a certain proprietary log file, i.e. it would refresh automatically every n seconds. Well, I got something working but it's damn sure the ugliest piece of code that I've written in ages. Everything seems to be a hack on top of another...

The question is, where do people turn to for documentation on writing Eclipse plugins? I know there's the online PDE guide and I've got a copy of "Contributing to Eclipse" but they seem to skip multithreading topics with a brief mention about the AWT event queue versus regular threads.

What are you using when hacking away at Eclipse plugins?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's almost at least four ways to do anything in the Eclipse APIs: the way the JDT does it, the way some other major plugin like Ant does it, the original way the core API did it (which they added after people complained that something JDT does should be available to others) and the "new" way the core does it, which is only used in a few places but will propagate through the rest of the API over the next few milestones. This pattern is repeated an astonishing number of times. It's a product of their public evolution and relatively compartmentalized project structure.

I have four Eclipse books and two SWT books, and I use all of them. I also do a lot of API browsing, and I read all the articles at www.eclipse.org. Learning to program Eclipse plugins isn't a destination: it's a never-ending voyage. The book I refer to the most these days, though, is Clayberg and Rubel (Building Commercial-Quality Plug-ins,) and I'd definitely recommend it. "The Java Developer's Guide to Eclipse" is good, too.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Ernest.

I also got something done by letting the wizard generate some classes from a template and then ripping out stuff I didn't need, swapping in a Canvas for a Table and that sort of stuff. Getting the data from outside the plugin was 10 minutes -- the problem is pushing that data to the Canvas so that the Canvas is actually redrawn etc.

Say, since you've apparently read almost all there is to developing Eclipse plugins, any chance your eyes would've caught some vague title of an article or a specific book that would've talked about using raw Canvases and/or periodic refreshes? Or a plugin that would do something like that that I could use as an example?

In the meanwhile, I suppose I'll have to try and see if reading all those articles would offer a solution (or, more likely, whether I can read fast enough

Or maybe I should try to take my "Listener", my "View", my "Viewer", my "Plugin", and bake them all into a single monolithic class. I have a hunch that not all of these Eclipse-generated classes are really needed for what I'm trying to do.
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both of the SWT books I have ("The Definitive Guide to SWT and JFace" from Apress and Manning's "SWT/JFace in Action") have some material about doing animation on Canvases, which is effectively what you're doing. The first book I listed has a clear and concise example on page 428-431 which would probably be a help.

They use Display.timerExec() to periodically call an animate() function. You could have your own thread poll the log and put the data in a queue, and have an animation function called this way pull data from the queue and draw the graph.

But as I said, there's more than one way to do it!
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ernest Friedman-Hill:
Both of the SWT books I have ("The Definitive Guide to SWT and JFace" from Apress and Manning's "SWT/JFace in Action") have some material about doing animation on Canvases, which is effectively what you're doing. The first book I listed has a clear and concise example on page 428-431 which would probably be a help.


You've got to be kidding! How could I miss that... (I've got the Apress book)

Originally posted by Ernest Friedman-Hill:
They use Display.timerExec() to periodically call an animate() function. You could have your own thread poll the log and put the data in a queue, and have an animation function called this way pull data from the queue and draw the graph.


Yep, I've got my own thread calling Canvas#redraw() (I think -- don't have the source code handy right now) every 10 seconds and the Canvas's PaintListener draws the graph based on whatever data it has at that time. The data gets pushed to a ViewContentProvider, which the Canvas's PaintListener asks for data to be drawn.

I'll have to look at the timerExec() approach.

Thanks a million!
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Is there a free online version of this book - "Building Commercial-Quality Plug-ins" by Clayberg and Rubel.


Thanks in advance.

Tanuja
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tanuja Rattan:

Is there a free online version of this book



No.
 
reply
    Bookmark Topic Watch Topic
  • New Topic