UserNotification.st
author ca
Fri, 12 Mar 2004 10:15:58 +0100
changeset 8165 d6446fc1ea3b
parent 7557 8eec03cef386
child 8703 d60d97138107
permissions -rw-r--r--
more stream protocol

"
 COPYRIGHT (c) 1999 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"


"{ Package: 'stx:libbasic' }"

Exception subclass:#UserNotification
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Kernel-Exceptions'
!

!UserNotification class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1999 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

!

documentation
"    
    UserNotification is the superclass of all user notification 
    exceptions in the system. It produces an info box with the message
    on the screen. If no display is available, the message is written 
    to the Transcript.

    [author:]
        Stefan Vogel

    [see also:]
        Signal
"
!

examples
"
                                                            [exBegin]
    UserNotification raiseRequest
                                                            [exEnd]

                                                            [exBegin]
    UserNotification raiseRequestWith:nil errorString:'what ?'
                                                            [exEnd]

                                                            [exBegin]
    UserNotification raiseRequestWith:nil errorString:' what ?'
                                                            [exEnd]
"

! !

!UserNotification class methodsFor:'initialization'!

initialize

    NotifierString := 'User Notification:'.

    "
     self initialize
    "

    "Created: / 23.7.1999 / 15:31:44 / stefan"
! !

!UserNotification class methodsFor:'compatibility-queries'!

isQuerySignal
    ^ true
! !

!UserNotification methodsFor:'default actions'!

defaultAction
    "Default action for notifications: open a info box with description"

    |text|

    text := self description.

    (Smalltalk isInitialized 
     and:[Dialog notNil
     and:[Screen notNil
     and:[Screen current notNil
     and:[Screen current isOpen
    ]]]]) ifTrue:[
        Dialog autoload.        "in case its autoloaded"
        Dialog information:text.
    ] ifFalse:[
        "
         on systems without GUI, simply show
         the message on the Transcript.
        "
        Transcript show:'notification: '; showCR:text.
    ].
    self proceed.


    "
      UserNotification raiseRequestErrorString:' abc'
    "

    "Modified: / 3.8.1999 / 14:06:55 / stefan"
! !

!UserNotification class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic/UserNotification.st,v 1.7 2003-08-18 12:17:07 cg Exp $'
! !

UserNotification initialize!