Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 380672

Summary: JDT UI should provide an API for calling the open type selection dialog
Product: [Eclipse Project] JDT Reporter: Michael Wenz <michael.wenz>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED INVALID QA Contact:
Severity: enhancement    
Priority: P3 CC: sebastian.zarnekow
Version: 3.8   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Michael Wenz CLA 2012-05-25 10:21:14 EDT
The OpenTypeSelectionDialog should be made accessible via an official API. Currently clients needs to directly use the internal class OpenTypeSelectionDialog.

We have a use case in the Graphiti project: we offer tool builders a wizard that allows them to create a basic plugin containing a Graphiti diagram editor (using PDE templates); during that the user has to option to reference a domain object which is basically a Java class from the current workspace or its references. The OpenTypeSelectionDialog just perfectly fits our needs here, but forces us to have a dependency to an internal JDT class.

A very simple API that opens the type selection popup and returns the type the user selected is fully sufficient for our needs. Maybe an option to set the title and message would be nice, but that is optional. We don't need to access the dialog class, so there's no need to move the class itself into an API package.
Comment 1 Sebastian Zarnekow CLA 2012-05-25 10:32:46 EDT
Did you try org.eclipse.jdt.ui.JavaUI.createTypeDialog(Shell, IRunnableContext, IJavaSearchScope, int, boolean, String, TypeSelectionExtension) and friends?
Comment 2 Michael Wenz CLA 2012-05-25 10:46:25 EDT
Thanks Sebastian for that hint. I spent quite some time with Google but did't stumble over this. It seems to be the perfect replacement for what I intended to do with OpenTypeSelectionDialog.