@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(); } }