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

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

Introduction

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

Prototype

SelectFromListDialog.ToStringAspect

Source Link

Usage

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

License:Open Source License

private ActionListener createProjTextListener() {
    return new ActionListener() {
        @Override/* w ww .  j a  va2  s. c  om*/
        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());
        }
    };
}