@Action public void pkCheckboxSelectionChanged(final NSButton sender) { log.debug("pkCheckboxSelectionChanged"); if (sender.state() == NSCell.NSOnState) { publicKeyPanel = NSOpenPanel.openPanel(); publicKeyPanel.setCanChooseDirectories(false); publicKeyPanel.setCanChooseFiles(true); publicKeyPanel.setAllowsMultipleSelection(false); publicKeyPanel.setMessage( Locale.localizedString("Select the private key in PEM or PuTTY format", "Credentials")); publicKeyPanel.setPrompt(Locale.localizedString("Choose")); publicKeyPanel.beginSheetForDirectory( LocalFactory.createLocal("~/.ssh").getAbsolute(), null, this.window(), this.id(), Foundation.selector("pkSelectionPanelDidEnd:returnCode:contextInfo:"), null); } else { this.pkSelectionPanelDidEnd_returnCode_contextInfo( publicKeyPanel, NSPanel.NSCancelButton, null); } }