Jump to: navigation, search

Difference between revisions of "FAQ How do I find a particular class from an Eclipse plug-in?"

(Removed closing LI tags)
m (Formatting)
Line 1: Line 1:
''
+
Suppose that you ask a question on the Eclipse newsgroup, and someone answers, "That's easy; just look at <tt>JavaAnnotationImageProvider</tt>". You are left scratching your head, wondering how to find that particular needle in the Eclipse haystack. Once you are familiar with searching for things in Eclipse, you too will come to realize that package names are rarely needed when browsing for information in the Eclipse source.
  
 +
The first thing you need to do is set up your workspace so that all Eclipse plug-ins are found by the Java search engine. This can be accomplished by loading all the Eclipse plug-ins into your workspace, but this quickly results in a cluttered workspace in which it is difficult to find your own projects. There is an easier approach to adding Eclipse plug-ins to the Java search engine's index.
  
 
+
* Activate the 'Plug-ins' view by going to '''Window > Show View > Other > PDE > Plug-ins'''.
Suppose that you ask a question on the Eclipse newsgroup, and someone
+
answers, &#147;That&#146;s easy; just look at <tt>JavaAnnotationImageProvider</tt>.&#148;
+
You are left scratching your head, wondering how to find that
+
particular needle in the Eclipse haystack.  Once you are familiar
+
with searching for things in Eclipse, you too will come to realize that package
+
names are rarely needed when browsing for information in the Eclipse source.
+
 
+
 
+
The first thing you need to do is set up your workspace so that all Eclipse
+
plug-ins are found by the Java search engine.  This can be accomplished by loading
+
all the Eclipse plug-ins into your workspace, but this quickly results
+
in a cluttered workspace in which it is difficult to find your own projects.
+
There is an easier approach to adding Eclipse plug-ins to the Java
+
search engine&#146;s index.
+
 
+
 
+
* Open the Plug-in Development perspective.
+
 
+
* Activate the Plug-ins view.
+
 
+
 
* Select all plug-ins in the view.
 
* Select all plug-ins in the view.
 
 
* From the context menu, select '''Add to Java Search'''.
 
* From the context menu, select '''Add to Java Search'''.
  
Once you have done this, switch back to the Java perspective
+
Once you have done this, switch back to the Java perspective and use '''Navigate > Open Type''' (or press Ctrl + Shift + T) and start typing the name of the class or interface you are looking for. You will now be able to quickly open an editor on any Java type in the Eclipse Platform.
and use '''Navigate &gt; Open Type'''
+
(or press Ctrl+Shift+T) and start typing the name of the class or interface
+
you are looking for. You will now be able to quickly open an editor
+
on any Java type in the Eclipse Platform.
+
 
+
 
+
 
+
 
+
In case you are curious, this works by creating in your workspace a Java project
+
called External Plug-in Libraries. This project will have all the Eclipse
+
plug-ins you selected on its build path, which ensures that they will be
+
consulted by the Java search engine when searching for and opening
+
Java types. You can use a similar technique to add other Java libraries to
+
the search index.  Simply add the JARs you want to be able to search to
+
the build path of any Java project in your workspace, and they will automatically
+
be included in the search.
+
 
+
 
+
 
+
 
+
== See Also: ==
+
  
 +
In case you are curious, this works by creating in your workspace a Java project called External Plug-in Libraries. This project will have all the Eclipse plug-ins you selected on its build path, which ensures that they will be consulted by the Java search engine when searching for and opening Java types. You can use a similar technique to add other Java libraries to the search index.  Simply add the JARs you want to be able to search to the build path of any Java project in your workspace, and they will automatically be included in the search.
  
 +
==See Also:==
 
[[FAQ_How_do_I_open_a_type_in_a_Java_editor%3F]]
 
[[FAQ_How_do_I_open_a_type_in_a_Java_editor%3F]]
 
 
 
[[FAQ_Where_can_I_find_the_Eclipse_plug-ins%3F]]
 
[[FAQ_Where_can_I_find_the_Eclipse_plug-ins%3F]]
  
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
 
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>

Revision as of 08:34, 14 December 2007

Suppose that you ask a question on the Eclipse newsgroup, and someone answers, "That's easy; just look at JavaAnnotationImageProvider". You are left scratching your head, wondering how to find that particular needle in the Eclipse haystack. Once you are familiar with searching for things in Eclipse, you too will come to realize that package names are rarely needed when browsing for information in the Eclipse source.

The first thing you need to do is set up your workspace so that all Eclipse plug-ins are found by the Java search engine. This can be accomplished by loading all the Eclipse plug-ins into your workspace, but this quickly results in a cluttered workspace in which it is difficult to find your own projects. There is an easier approach to adding Eclipse plug-ins to the Java search engine's index.

  • Activate the 'Plug-ins' view by going to Window > Show View > Other > PDE > Plug-ins.
  • Select all plug-ins in the view.
  • From the context menu, select Add to Java Search.

Once you have done this, switch back to the Java perspective and use Navigate > Open Type (or press Ctrl + Shift + T) and start typing the name of the class or interface you are looking for. You will now be able to quickly open an editor on any Java type in the Eclipse Platform.

In case you are curious, this works by creating in your workspace a Java project called External Plug-in Libraries. This project will have all the Eclipse plug-ins you selected on its build path, which ensures that they will be consulted by the Java search engine when searching for and opening Java types. You can use a similar technique to add other Java libraries to the search index. Simply add the JARs you want to be able to search to the build path of any Java project in your workspace, and they will automatically be included in the search.

See Also:

FAQ_How_do_I_open_a_type_in_a_Java_editor? FAQ_Where_can_I_find_the_Eclipse_plug-ins?


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.