@Override public void callback(final int returncode) { if(alert.suppressionButton().state() == NSCell.NSOnState) { // Never show again. preferences.setProperty("browser.move.confirm", false); } if(returncode == DEFAULT_OPTION) { new OverwriteController(parent).overwrite(new ArrayList<Path>(selected.values()), action); } } });
@Override public void callback(final int returncode) { if(alert.suppressionButton().state() == NSCell.NSOnState) { // Never show again. preferences.setProperty("browser.copy.confirm", false); } if(returncode == DEFAULT_OPTION) { new OverwriteController(parent).overwrite(new ArrayList<Path>(selected.values()), action); } } });
@Override public void callback(int returncode) { if(alert.suppressionButton().state() == NSCell.NSOnState) { // Never show again. preferences.setProperty("browser.disconnect.confirm", false); } callback.callback(returncode); } });
@Override public void callback(int returncode) { if(alert.suppressionButton().state() == NSCell.NSOnState) { // Never show again. preferences.setProperty("queue.size.warn", Integer.MAX_VALUE); } if(returncode == DEFAULT_OPTION) { clearButtonClicked(null); } add(transfer); background(action); } });
alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't ask again", "Configuration")); parent.alert(alert, new SheetCallback() { @Override
alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't ask again", "Configuration")); parent.alert(alert, new SheetCallback() { @Override
protected void loadBundle(final NSAlert alert) { this.alert = alert; alert.setShowsHelp(true); alert.setDelegate(this.id()); if(alert.showsSuppressionButton()) { alert.suppressionButton().setTarget(this.id()); alert.suppressionButton().setAction(Foundation.selector("suppressionButtonClicked:")); } // Layout alert view on main thread this.focus(alert); this.setWindow(alert.window()); }
@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); }
alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't ask again", "Configuration")); this.alert(alert, new SheetCallback() { @Override
@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.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.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 cleanup() { for(ThirdpartyBookmarkCollection t : collections) { t.filter(bookmarks); if(t.isEmpty()) { preferences.setProperty(t.getConfiguration(), true); continue; } final NSAlert alert = NSAlert.alert( MessageFormat.format(LocaleFactory.localizedString("Import {0} Bookmarks", "Configuration"), t.getName()), MessageFormat.format(LocaleFactory.localizedString("{0} bookmarks found. Do you want to add these to your bookmarks?", "Configuration"), t.size()), LocaleFactory.localizedString("Import", "Configuration"), //default null, //other LocaleFactory.localizedString("Cancel", "Configuration")); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't ask again", "Configuration")); alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); int choice = new AlertSheetReturnCodeMapper().getOption(alert.runModal()); //alternate if(alert.suppressionButton().state() == NSCell.NSOnState) { // Never show again. preferences.setProperty(t.getConfiguration(), true); } if(choice == SheetCallback.DEFAULT_OPTION) { bookmarks.addAll(t); // Flag as imported preferences.setProperty(t.getConfiguration(), true); } } } }
@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); } }
alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't ask again", "Configuration")); this.alert(alert, new SheetCallback() { @Override
@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); }
alert.setAlertStyle(NSAlert.NSWarningAlertStyle); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't ask again", "Configuration")); int choice = new AlertSheetReturnCodeMapper().getOption(alert.runModal()); if(alert.suppressionButton().state() == NSCell.NSOnState) {
alert.setAlertStyle(NSAlert.NSInformationalAlertStyle); alert.setShowsSuppressionButton(true); alert.suppressionButton().setTitle(LocaleFactory.localizedString("Don't ask again", "Configuration")); int choice = new AlertSheetReturnCodeMapper().getOption(alert.runModal()); if(alert.suppressionButton().state() == NSCell.NSOnState) {