public static NSAlert alert( String title, String message, String defaultButton, String alternateButton, String otherButton) { NSAlert alert = NSAlert.alert(); alert.setMessageText(title); alert.setInformativeText(new StringAppender().append(message).toString()); if(StringUtils.isNotBlank(defaultButton)) { // OK alert.addButtonWithTitle(defaultButton); } if(StringUtils.isNotBlank(otherButton)) { // Cancel alert.addButtonWithTitle(otherButton); } if(StringUtils.isNotBlank(alternateButton)) { alert.addButtonWithTitle(alternateButton); } return alert; }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(MessageFormat.format(LocaleFactory.localizedString("Listing directory {0}", "Status"), StringUtils.EMPTY)); alert.setInformativeText(MessageFormat.format(LocaleFactory.localizedString("Continue listing directory with more than {0} files.", "Alert"), e.getChunk().size())); alert.addButtonWithTitle(LocaleFactory.localizedString("Continue", "Credentials")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always")); super.loadBundle(alert); } }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setMessageText(LocaleFactory.localizedString("Redirect")); alert.setInformativeText(LocaleFactory.localizedString(String.format("Allow redirect for method %s", method), "Alert")); alert.addButtonWithTitle(LocaleFactory.localizedString("Allow")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "Alert")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always")); super.loadBundle(alert); } }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSWarningAlertStyle); alert.setMessageText(MessageFormat.format(LocaleFactory.localizedString("Changed fingerprint", "Sftp"), hostname)); alert.setInformativeText(MessageFormat.format(LocaleFactory.localizedString("The fingerprint for the {1} key sent by the server is {0}.", "Sftp"), fingerprint, KeyType.fromKey(key).name())); alert.addButtonWithTitle(LocaleFactory.localizedString("Allow")); alert.addButtonWithTitle(LocaleFactory.localizedString("Deny")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always")); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSWarningAlertStyle); alert.setMessageText(MessageFormat.format(LocaleFactory.localizedString("Unknown fingerprint", "Sftp"), hostname)); alert.setInformativeText(MessageFormat.format(LocaleFactory.localizedString("The fingerprint for the {1} key sent by the server is {0}.", "Sftp"), fingerprint, KeyType.fromKey(key).name())); alert.addButtonWithTitle(LocaleFactory.localizedString("Allow")); alert.addButtonWithTitle(LocaleFactory.localizedString("Deny")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always")); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(LocaleFactory.localizedString("Create new symbolic link", "File")); alert.setInformativeText(MessageFormat.format(LocaleFactory.localizedString("Enter the name for the new symbolic link for {0}", "File"), selected.getName())); alert.addButtonWithTitle(LocaleFactory.localizedString("Create", "File")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "File")); alert.setIcon(IconCacheFactory.<NSImage>get().aliasIcon(null, 64)); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(LocaleFactory.localizedString("Choose Region", "Folder")); alert.setInformativeText(LocaleFactory.localizedString("Select the region for the new folder", "Folder")); alert.addButtonWithTitle(LocaleFactory.localizedString("Choose")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "Folder")); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(LocaleFactory.localizedString("New Download", "Download")); alert.setInformativeText(LocaleFactory.localizedString("URL", "Download")); alert.addButtonWithTitle(LocaleFactory.localizedString("Download", "Download")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "Download")); this.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSWarningAlertStyle); alert.setMessageText(LocaleFactory.localizedString("Apply changes recursively")); alert.setInformativeText(MessageFormat.format(LocaleFactory.localizedString("Do you want to set {0} on {1} recursively for all contained files?"), value, directory.getName())); alert.addButtonWithTitle(LocaleFactory.localizedString("Continue", "Credentials")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always")); super.loadBundle(alert); } }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSWarningAlertStyle); alert.setMessageText(title); alert.setInformativeText(message); alert.addButtonWithTitle(continueButton); alert.addButtonWithTitle(disconnectButton); alert.setShowsHelp(true); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't show again", "Credentials")); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setIcon(IconCacheFactory.<NSImage>get().iconNamed(options.icon, 64)); alert.setMessageText(title); alert.setInformativeText(reason); alert.addButtonWithTitle(LocaleFactory.localizedString("Continue", "Credentials")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "Alert")); alert.setShowsSuppressionButton(false); this.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(LocaleFactory.localizedString("Create Vault", "Cryptomator")); alert.setInformativeText(LocaleFactory.localizedString("Enter the name for the new folder", "Folder")); alert.addButtonWithTitle(LocaleFactory.localizedString("Create Vault", "Cryptomator")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "Folder")); alert.setIcon(IconCacheFactory.<NSImage>get().iconNamed("cryptomator.tiff", 64)); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(LocaleFactory.localizedString("Go to folder", "Goto")); alert.setInformativeText(LocaleFactory.localizedString("Enter the pathname to list:", "Goto")); alert.addButtonWithTitle(LocaleFactory.localizedString("Go", "Goto")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "Goto")); alert.setIcon(IconCacheFactory.<NSImage>get().folderIcon(64)); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(LocaleFactory.localizedString("Duplicate File", "Duplicate")); alert.setInformativeText(LocaleFactory.localizedString("Enter the name for the new file", "Duplicate")); alert.addButtonWithTitle(LocaleFactory.localizedString("Duplicate", "Duplicate")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "Duplicate")); alert.setIcon(IconCacheFactory.<NSImage>get().fileIcon(selected, 64)); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(LocaleFactory.localizedString("Create new folder", "Folder")); alert.setInformativeText(LocaleFactory.localizedString("Enter the name for the new folder", "Folder")); alert.addButtonWithTitle(LocaleFactory.localizedString("Create", "Folder")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "Folder")); alert.setIcon(IconCacheFactory.<NSImage>get().iconNamed("newfolder.tiff", 64)); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setMessageText(null == failure.getMessage() ? LocaleFactory.localizedString("Unknown") : failure.getMessage()); alert.setInformativeText(null == failure.getDetail() ? LocaleFactory.localizedString("Unknown") : failure.getDetail()); alert.addButtonWithTitle(defaultButton); alert.addButtonWithTitle(cancelButton); if(new DefaultFailureDiagnostics().determine(failure) == FailureDiagnostics.Type.network) { alert.addButtonWithTitle(LocaleFactory.localizedString("Network Diagnostics", "Alert")); } this.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setMessageText(LocaleFactory.localizedString("Create new file", "File")); alert.setInformativeText(LocaleFactory.localizedString("Enter the name for the new file", "File")); alert.addButtonWithTitle(LocaleFactory.localizedString("Create", "File")); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel", "File")); if(EditorFactory.instance().getDefaultEditor() != Application.notfound) { alert.addButtonWithTitle(LocaleFactory.localizedString("Edit", "File")); } alert.setIcon(IconCacheFactory.<NSImage>get().documentIcon(null, 64)); super.loadBundle(alert); }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setAlertStyle(NSAlert.NSWarningAlertStyle); alert.setMessageText(null == failure.getMessage() ? LocaleFactory.localizedString("Unknown") : failure.getMessage()); alert.setInformativeText(null == failure.getDetail() ? LocaleFactory.localizedString("Unknown") : failure.getDetail()); alert.addButtonWithTitle(LocaleFactory.localizedString("Cancel")); alert.addButtonWithTitle(LocaleFactory.localizedString("Continue", "Credentials")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Always")); super.loadBundle(alert); } }
@Override public void loadBundle() { final NSAlert alert = NSAlert.alert(); alert.setMessageText(LocaleFactory.localizedString("Thank you for using Cyberduck!", "Donate")); final StringAppender message = new StringAppender(); message.append(LocaleFactory.localizedString("This is free software, but it still costs money to write, support, and distribute it. If you enjoy using it, please consider a donation to the authors of this software. It will help to make Cyberduck even better!", "Donate")); message.append(LocaleFactory.localizedString("As a contributor to Cyberduck, you receive a registration key that disables this prompt.", "Donate")); alert.setInformativeText(message.toString()); alert.addButtonWithTitle(LocaleFactory.localizedString("Donate", "Donate")); alert.addButtonWithTitle(LocaleFactory.localizedString("Later", "Donate")); alert.addButtonWithTitle(LocaleFactory.localizedString("Buy in Mac App Store", "Donate")); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setShowsSuppressionButton(preferences.getBoolean("donate.reminder.suppress.enable")); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't show again for this version", "Donate")); this.loadBundle(alert); }