Пример #1
0
 @Action
 public void downloadPathPopupClicked(final NSMenuItem sender) {
   if (sender.title().equals(CHOOSE)) {
     downloadPathPanel = NSOpenPanel.openPanel();
     downloadPathPanel.setCanChooseFiles(false);
     downloadPathPanel.setCanChooseDirectories(true);
     downloadPathPanel.setAllowsMultipleSelection(false);
     downloadPathPanel.setCanCreateDirectories(true);
     downloadPathPanel.beginSheetForDirectory(
         null,
         null,
         this.window,
         this.id(),
         Foundation.selector("downloadPathPanelDidEnd:returnCode:contextInfo:"),
         null);
   } else {
     host.setDownloadFolder(LocalFactory.createLocal(sender.representedObject()));
     this.itemChanged();
   }
 }
Пример #2
0
 @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);
   }
 }