NEWS

 

 




| Printer Friendly | Post Reply
Loosely Coupled But Tightly Integrated

Wayne Beaton is not impressed with how tightly coupled his image viewer is with the resources API. His solution to the problem involves reworking the plug-in to make it ‘exploit’ the Eclipse adapter mechanism. The powerful adapter mechanism makes it possible to build plug-ins that ‘work really well together but know nothing about each other’.

“The basic idea is that I want my image viewer to display an image for the selected thing, whatever it is. So it registers a selection listener with the workbench selection service; the selection listener is notified whenever a selection occurs in a table, tree, editor, whatever. The image viewer looks at the selection and tries to determine how to display an image for it. To do this, it attempts to adapt the selected thing into an instance of the ImageProvider type and then asks the ImageProvider for the image. If the selected thing cannot be adapted to the appropriate type, the whole process is aborted, so the image viewer displays the last thing that was selected that could provide an image,” Wayne says.

To insulate the image viewer from having any knowledge of the resources API, Wayne created a separate plug-in that knows about both the image viewer and the resource plug-in, but these plug-ins are isolated from each other. To add support to display images for other types of objects, Wayne adds the org.eclipse.core.runtime.adapters extension. He also provides links to the project set and the image viewer plug-ins.

  Read the post
 


Yatego Shopping with more than 4000 Shops and with over 1.8 Mio Products. Branchenbuch and over 500.000 Bücher. Inspiration with Themeworld and Technic. A mobilephone- and Handy Shop with Nokia Handy, Motorola Handy and Sony Handy. With our Bestseller easily find Schuhe, Jeans, Kinderschuhe or a Digitalkamera, perhaps a Canon Digitalkamera. More Bestseller: Modellbahn, Diddl and Poker. Find Schmuck or Silberschmuck as easy as an Apple Ipod, Weber Grill or an Akkuschrauber.


  About Us | Advertise | Contact | Feedback | Publisher Copyright © 2007 Software & Support Media.
Any Questions?   Imprint | Privacy Policy