Home > work > Plug-in Development Tip

Plug-in Development Tip

April 22nd, 2008

Ever wanted to browse for a Java class but not import the whole universe in your workspace? Well here is a tip for you… I’ll do it in pictures.

I start with an empty workspace… and I want to find the EObject class from EMF. I Ctrl+Shift+T my way to sadness:

:(

However, there is a Plug-ins view in Eclipse from PDE that allows me to add plug-ins to ‘Java Search.’

Now I try searching for my EObject class:

Now I’m happy :)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Technorati
Author: Chris Aniszczyk Categories: work Tags: , ,
  • Robert Konigsberg
    Nice, thanks.
  • Chris Aniszczyk (zx)
    Eugene, we may be doing an ugly trick, but it is a very useful trick. It has worked for many people for a long time :)


    Yuri, that's just from experience. One straight people do is simply select everything in the plug-ins view and add it to java search... but I don't really recommend that approach. Usually, you're only interested in the plug-ins you're developing against (eg., EMF)



    Martin, that is an interesting question. JDT UI has a concept of Type Filters that you can apply to that dialog. However, I don't think there is anything that will help you just browse by EE... however, that would be a very reasonable enhancement reques to be raised against JDT UI.
  • Martin Oberhuber
    Nice. Does it also work the other way round? - My workspace has lots of projects associated with different Execution Environments, and my Preferences actually have those. So when I Ctrl+Shift+T e.g. "String" I get matches from JDK 1.6, 1.5, 1.4, and J9 Foundation-1.1 ... opening all those Classpaths kills my Performance for Ctrl+Shift+T.


    Can I disable some classpaths from Ctrl+Shift+T?
  • Eugene Kuleshov
    I also agree with Yury. PDE is doing somewhat ugly trick and creates hidden "External Plug-in Libraries" project in order to trick the Open Type dialog. But I talked to JDT guys and they said that there is now better API that could be used to plug-in custom sources into the search engine and there is also new extension point for quick fix for missing types/jars.
  • Michael Scharf
    This is one of the things we let our participants of the RCP tutorial run into.


    The interesting thing is that "old" eclipse users expect to see all classes from all plugins in the "Open Type..." dialog. It used to be that way until eclipse 3.1 or so...
  • Yury Kats
    Great tip, but how do you know what plugin to add to begin with? How did yuo know where EObject comes from?
  • Francis
    Yum. Thanks. I have this problem all the time.
  • Markus Scheidgen
    Lovely tip. Thanks for posting this. This is one of those tricks you need to know, but never learn. Why doesn't one know these kinda things by oneself?


    Markus
blog comments powered by Disqus
Get Adobe Flash playerPlugin by wpburn.com wordpress themes