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
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
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),
            SearchEngine.createWorkspaceScope(),
            IJavaElementSearchConstants.CONSIDER_ALL_TYPES, false);
        dialog.setTitle("My Dialog Title");
        dialog.setMessage("My Dialog Message");
        if (dialog.open() == 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