@Override public void callback(final int returncode) { callback.callback(returncode); } };
public void cancel(ID sender) { callback.callback(SheetCallback.CANCEL_OPTION); } }
/** * Called by the runtime after a sheet has been dismissed. Ends any modal session and * sends the returncode to the callback implementation. Also invalidates this controller to be * garbage collected and notifies the lock object * * @param sheet Sheet window * @param returncode Identifier for the button clicked by the user * @param contextInfo Not used */ public void sheetDidClose_returnCode_contextInfo(final NSWindow sheet, final int returncode, final ID contextInfo) { sheet.endEditingFor(null); sheet.orderOut(contextInfo); this.returncode = returncode; callback.callback(returncode); signal.countDown(); }
@Override public void callback(int returncode) { if(alert.suppressionButton().state() == NSCell.NSOnState) { // Never show again. preferences.setProperty("browser.disconnect.confirm", false); } callback.callback(returncode); } });
/** * This must be the target action for any button in the sheet dialog. Will validate the input * and close the sheet; #sheetDidClose will be called afterwards * * @param sender A button in the sheet dialog */ @Action public void closeSheet(final NSButton sender) { if(log.isDebugEnabled()) { log.debug(String.format("Close sheet with button %s", sender.title())); } final int option = new AlertSheetReturnCodeMapper().getOption(sender); if(option == SheetCallback.DEFAULT_OPTION || option == SheetCallback.ALTERNATE_OPTION) { window.endEditingFor(null); if(!this.validate()) { AppKitFunctionsLibrary.beep(); return; } } callback.callback(option); application.endSheet(window, option); }
callback.callback(SheetCallback.CANCEL_OPTION);