void (final ActionEvent e) { // 1. Check that bundle exist. Otherwise we cannot show key chooser final String bundleName = myTfBundleName.getText(); if (bundleName.length() == 0) { Messages.showErrorDialog( UIDesignerBundle.message("error.specify.bundle.name"), CommonBundle.getErrorTitle() ); return; } final PropertiesReferenceManager manager = PropertiesReferenceManager.getInstance(myEditor.getProject()); final PropertiesFile bundle = manager.findPropertiesFile(myEditor.getModule(), bundleName.replace('/', '.'), myLocale); if (bundle == null) { Messages.showErrorDialog( UIDesignerBundle.message("error.bundle.does.not.exist", bundleName), CommonBundle.getErrorTitle() ); return; } // 2. Show key chooser final KeyChooserDialog dialog = new KeyChooserDialog( myTfKey, bundle, bundleName, myTfKey.getText(), // key to preselect myEditor ); if (!dialog.showAndGet()) { return; } // 3. Apply new key/value final StringDescriptor descriptor = dialog.getDescriptor(); if (descriptor == null) { return; } myTfKey.setText(descriptor.getKey()); myTfRbValue.setText(descriptor.getResolvedValue()); }