2011年2月28日星期一

Eclipse Extension Point Information Search and Java Source Search

Eclipse Resource Search



Summary



You may need an example since you encounter some problems with writing the code of eclipse.
It's easier for you to follow the example.
The source code of eclipse itself is one of the best example,
The problem is how to find these examples quickly.


By Jim Liu


January 28, 2011






Introduction


Quick Search the information of Plug-in.







Bundle Search




find Bundles with ExtensionPoint name,subPath,attribute name,attribute value. see example below.




search Eclipse Bundles which implements ExtensionPoint "org.eclipse.ui.viewActions" and with sub path "/viewContribution/action"




search Eclipse Bundles which implements ExtensionPoint "org.eclipse.ui.menus" and with sub path "/menuContribution/command@commandId"







try





ExtensionPoint Search




The names of ExtensionPoint and Bundle are related,for example org.eclipse.ui.Actions is defined in org.eclipse.ui of bundle.
but not all of the extension point have this kind of matchup,such as org.eclipse.core.runtime.adapters is defined in org.eclipse.equinox.registry of Bundle.
Search the plugin where the Extensionpoint defined

Input org.eclipse.core.runtime.contentTypes in the search box







try





Extension Attribute Search




org.eclipse.ui.bindings used to define the keyboard bind





<extension
point="org.eclipse.ui.bindings">
<key
sequence="M2+M3+D E"
commandId="org.eclipse.pde.ui.runtimeWorkbenchShortcut.debug"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
</extension>




If you want to know which keys were binded,you can input the keyword of searching like org.eclipse.ui.bindings,/key,sequence,as following picture:








For some attributes,you may not know what keywords you suppose to input,such as the path value of org.eclipse.ui.popupMenus /objectContribution/menu.


You can also search what other people typed in the search box,input the searching keywords,
and click the search button,you can get the result as following picture.
You will get there are additions in other plugins,so it’s okay if you do so.



Click the value to enter the page of Bundle list,fill out all of the value of path which equals additions in these bundle pages.You can refer to the content of plugin.xml.



try







Source Code Search





If you find a class of Java without source code while you developing code,for example:org.eclipse.swt.widgets.Button,
you know the qualified name of this class,
but your development environment have no source code,you could input org.eclipse.swt.widgets.Button,
in the search result,click the link,you will view the source code.






try




Search class by class name



Many java developers maybe have used Eclipse Package Explorer.






If you want to implement your resource view just like package view ,
you may reference the source code of Eclipse,but you probably don't know the qualified class name which implements Package Explorer,
just input Package Explorer,click search button and you will find the class name "PackageExplorerPart" soon from the result.
this is the class what you need.click the link,you can view the source code,see image below.







try