how to open jar selection dialog at the eclipse pulgin code
At开发者_JS百科 Project > Properties > Java Build Path > Libraries tab you click Add Jars button, you will see the JAR Selection dialog.
I like to open this JAR Selection dialog on my plugin code.
How to open this?
With the Eclipse RCP edition (which you must have since you are developing a plugin), you can use the Plugin Spy (Alt+Shift+F1) and see what exact class you need:
alt text http://img541.imageshack.us/img541/2232/eclipsetreesel.png
It is based on org.eclipse.jdt.internal.ui.viewsupport.FilteredElementTreeSelectionDialog
(strangely absent from the sources of org.eclipse.jdt.internal.ui.viewsupport
), derived from org.eclipse.ui.dialogs.ElementTreeSelectionDialog
.
If you want to see how it is opened, you need to have a look to the global window opening that dialog:
alt text http://img41.imageshack.us/img41/1903/eclipselibclass.png
It is the org.eclipse.jdt.internal.ui.preferences.BuildPathsPropertyPage
, from which you can infer the various action classes associated with the button and see how it works.
精彩评论