Example usage for com.intellij.openapi.ui SelectFromListDialog show

List of usage examples for com.intellij.openapi.ui SelectFromListDialog show

Introduction

In this page you can find the example usage for com.intellij.openapi.ui SelectFromListDialog show.

Prototype

public void show() 

Source Link

Document

Show the dialog.

Usage

From source file:com.microsoft.intellij.ui.azureroles.DebugConfigurationDialog.java

License:Open Source License

private ActionListener createProjTextListener() {
    return new ActionListener() {
        @Override//from   w  w w . j a va2  s  .com
        public void actionPerformed(ActionEvent e) {
            SelectFromListDialog dialog = new SelectFromListDialog(project,
                    ModuleManager.getInstance(project).getModules(), new SelectFromListDialog.ToStringAspect() {
                        @Override
                        public String getToStirng(Object obj) {
                            return ((Module) obj).getName();
                        }
                    }, message("dbgProjSelTitle"), ListSelectionModel.SINGLE_SELECTION);
            dialog.show();
            if (dialog.getSelection() != null && dialog.getSelection().length > 0)
                projText.setText(((Module) dialog.getSelection()[0]).getName());
        }
    };
}