eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'YesToAllConfirmation':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: YesToAllConfirmation


Inheritance:

   Object
   |
   +--GenericException
      |
      +--Notification
         |
         +--YesToAllConfirmation
            |
            +--SameForAllNotification

Package:
stx:libbasic
Category:
Kernel-Exceptions-Notifications
Version:
rev: 1.7 date: 2014/12/30 12:40:05
user: cg
file: YesToAllConfirmation.st directory: libbasic
module: stx stc-classLibrary: libbasic

Description:


used with confirmation dialogs, especially from the filebrowser and compilers
to up-notify that further such confirmations are not wanted by the user.


Class protocol:

queries
o  notify
raise a notification; usually will be remembered in a handler for the next
query to return true

utilities
o  handleConfirmationIn: aBlock
evaluate aBlock;
if inside that block, a query for YesToAll is raised, remember it and
answer it as required.

usage example(s):

      YesToAllConfirmation
        handleConfirmationIn:[
            1 to:5 do:[:i |
                |confirmed|

                YesToAllConfirmation query ifFalse:[
                    confirmed := OptionBox
                                  request:(i printString)
                                  label:('Ask again and again')
                                  image:(YesNoBox iconBitmap)
                                  buttonLabels:#('Cancel' 'No' 'Yes' 'Yes to All')
                                  values:#(nil false true #yesToAll)
                                  default:false
                                  onCancel:false.
                    confirmed == #yesToAll ifTrue:[
                        YesToAllConfirmation notify
                    ].
                ].
                Transcript showCR:i.
            ].
        ].


Instance protocol:

defaults
o  defaultResumeValue
the default answer, if no one handles the query



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 15:39:40 GMT