Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




EclipseJDT Plug-in Developer Guide
Previous Page Home Next Page

Creating Java specific prompter dialogs

The following snippet uses the JavaUI class to open the Open Type dialog:

    public IType selectType() throws JavaModelException {
        Shell parent = ...;
        SelectionDialog dialog= JavaUI.createTypeDialog(
            parent, new ProgressMonitorDialog(parent),
            IJavaElementSearchConstants.CONSIDER_ALL_TYPES, false);
        dialog.setTitle("My Dialog Title");
        dialog.setMessage("My Dialog Message");
        if ( == IDialogConstants.CANCEL_ID)
            return null;

        Object[] types= dialog.getResult();
        if (types == null || types.length == 0)
            return null;
        return (IType)types[0];

JavaUI provides additional methods for creating Open Package and Open Main Type dialogs.

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire