Twitter github

Plug-in Development Tip

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 πŸ™‚

  • 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

  • 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

  • Francis

    Yum. Thanks. I have this problem all the time.

  • Francis

    Yum. Thanks. I have this problem all the time.

  • Yury Kats

    Great tip, but how do you know what plugin to add to begin with? How did yuo know where EObject comes from?

  • Yury Kats

    Great tip, but how do you know what plugin to add to begin with? How did yuo know where EObject comes from?

  • 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…

  • 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…

  • 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.

  • 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.

  • 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?

  • 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?

  • 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.

  • 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.

  • Robert Konigsberg

    Nice, thanks.

  • Robert Konigsberg

    Nice, thanks.