Warning.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 24096 98fa8c26986e
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23777
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
     1
"{ Encoding: utf8 }"
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
     2
4466
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
     3
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
     4
 COPYRIGHT (c) 1999 by eXept Software AG
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
     5
              All Rights Reserved
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
     6
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
     7
 This software is furnished under a license and may be used
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
     8
 only in accordance with the terms of that license and with the
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    10
 be provided or otherwise made available to, or used by, any
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    11
 other person.  No title to or ownership of the software is
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    12
 hereby transferred.
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    13
"
6206
59d1ec1e1ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5295
diff changeset
    14
"{ Package: 'stx:libbasic' }"
59d1ec1e1ed5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5295
diff changeset
    15
17307
8dfa29195a23 class: Warning
Claus Gittinger <cg@exept.de>
parents: 16423
diff changeset
    16
"{ NameSpace: Smalltalk }"
8dfa29195a23 class: Warning
Claus Gittinger <cg@exept.de>
parents: 16423
diff changeset
    17
7032
3c0246b4e602 Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents: 6427
diff changeset
    18
UserNotification subclass:#Warning
23777
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
    19
	instanceVariableNames:'optionalTitle'
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    22
	category:'Kernel-Exceptions'
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    23
!
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    24
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    25
!Warning class methodsFor:'documentation'!
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    26
4466
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    27
copyright
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    28
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    29
 COPYRIGHT (c) 1999 by eXept Software AG
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    30
              All Rights Reserved
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    31
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    32
 This software is furnished under a license and may be used
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    33
 only in accordance with the terms of that license and with the
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    35
 be provided or otherwise made available to, or used by, any
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    36
 other person.  No title to or ownership of the software is
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    37
 hereby transferred.
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    38
"
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    39
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    40
!
9cba6f4ecec4 copyrights added; typo in docu
Claus Gittinger <cg@exept.de>
parents: 4446
diff changeset
    41
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    42
documentation
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    43
"
12279
a76ac48afbdf changed: #documentation
Claus Gittinger <cg@exept.de>
parents: 12083
diff changeset
    44
    Warning is the superclass of all warning signals in the system.
7038
89e892bb8226 Documentation
Stefan Vogel <sv@exept.de>
parents: 7032
diff changeset
    45
    The default beavior for an unhandled Warning is to display a warn
89e892bb8226 Documentation
Stefan Vogel <sv@exept.de>
parents: 7032
diff changeset
    46
    box with the error decription. If no display is available, the error 
89e892bb8226 Documentation
Stefan Vogel <sv@exept.de>
parents: 7032
diff changeset
    47
    description is written to the Transcript.
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    48
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    49
    [author:]
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    50
        Stefan Vogel
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    51
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    52
    [see also:]
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    53
        Signal
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    54
"
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    55
!
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    56
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    57
examples
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    58
"
6427
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    59
  show a warning:
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    60
                                                            [exBegin]
6427
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    61
    Transcript showCR:'1 - now raising'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    62
    Warning raiseRequest.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    63
    Transcript showCR:'2 - after the raise'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    64
                                                            [exEnd]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    65
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    66
  passing an errorString:
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    67
                                                            [exBegin]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    68
    Warning raiseRequestErrorString:'hello world'
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    69
                                                            [exEnd]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    70
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    71
  provide a handler for warnings:
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    72
                                                            [exBegin]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    73
    Warning handle:[:ex |
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    74
        Transcript showCR:'WARNING: ' , ex description
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    75
    ] do:[
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    76
        '...'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    77
        Warning raiseRequest.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    78
        '...'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    79
    ].
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    80
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    81
    Warning handle:[:ex |
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    82
        Transcript showCR:'WARNING: ' , ex description
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    83
    ] do:[
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    84
        '...'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    85
        Warning raiseRequestErrorString:'hello world'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    86
        '...'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    87
    ]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    88
                                                            [exEnd]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    89
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    90
  ignore warnings during some evaluation:
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    91
                                                            [exBegin]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    92
    Warning ignoreIn:[
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    93
        '...'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    94
        Warning raiseRequest.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    95
        '...'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    96
    ]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    97
                                                            [exEnd]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    98
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
    99
  defer a warning to some later time:
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   100
                                                            [exBegin]
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   101
    Warning deferAfter:[
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   102
        Transcript showCR:'1 - no warning here ...'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   103
        Warning raiseRequestErrorString:'this warning is deferred'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   104
        Transcript showCR:'2 - but in a second...'.
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   105
    ].
890d7bd17cce documentation
Claus Gittinger <cg@exept.de>
parents: 6206
diff changeset
   106
    Transcript showCR:'3 - after warning-protected block'.
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   107
                                                            [exEnd]
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   108
"
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   109
! !
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   110
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   111
!Warning class methodsFor:'initialization'!
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   112
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   113
initialize
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   114
7032
3c0246b4e602 Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents: 6427
diff changeset
   115
    NotifierString := 'Warning:'.
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   116
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   117
    "
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   118
     self initialize
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   119
    "
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   120
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   121
    "Created: / 23.7.1999 / 15:34:27 / stefan"
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   122
! !
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   123
12083
079b2535924f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10517
diff changeset
   124
23777
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   125
!Warning methodsFor:'accessing'!
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   126
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   127
title:aWarnBoxWindowTitle
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   128
    "an optional title for the warn box"
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   129
    
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   130
    optionalTitle := aWarnBoxWindowTitle.
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   131
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   132
    "Created: / 26-02-2019 / 15:41:47 / Claus Gittinger"
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   133
! !
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   134
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   135
!Warning methodsFor:'default actions'!
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   136
4525
999e680a29ca Make error classes public.
Stefan Vogel <sv@exept.de>
parents: 4508
diff changeset
   137
defaultAction
5295
f144309dab04 #errorString --> #description
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   138
    "Default action for warnings: open a warn box with description"
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   139
16423
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   140
    self showWarnDialog.
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   141
    self proceed.
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   142
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   143
    "
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   144
      Warning raiseRequestErrorString:' abc'
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   145
    "
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   146
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   147
    "Modified: / 3.8.1999 / 14:06:41 / stefan"
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   148
!
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   149
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   150
showWarnDialog
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   151
    "open a warn box with description"
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   152
24096
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   153
    |maxLineLength text collectedLines|
4500
be0fe7e7e21b Write to transcript if Dialog is not available.
Stefan Vogel <sv@exept.de>
parents: 4466
diff changeset
   154
24096
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   155
    maxLineLength := 150.
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   156
    
5295
f144309dab04 #errorString --> #description
Stefan Vogel <sv@exept.de>
parents: 4525
diff changeset
   157
    text := self description.
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   158
24023
d28afa3c1a06 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23777
diff changeset
   159
    (self suppressDialogIfUnhandled not and:[self hasDialog]) ifTrue:[
24096
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   160
        text := text asStringCollection.
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   161
        (text contains:[:line | line size > maxLineLength]) ifTrue:[
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   162
            collectedLines := StringCollection new.
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   163
            text do:[:line |
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   164
                |first|
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   165
                
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   166
                line size > maxLineLength ifTrue:[
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   167
                    first := true.
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   168
                    (line splitForSize:maxLineLength) do:[:eachPart |
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   169
                        first ifTrue:[
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   170
                            collectedLines add:eachPart.
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   171
                            first := false.
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   172
                        ] ifFalse:[
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   173
                            collectedLines add:(('    >> ' withColor:Color lightGrey),eachPart)
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   174
                        ].    
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   175
                    ].
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   176
                ] ifFalse:[
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   177
                    collectedLines add:line
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   178
                ].    
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   179
            ].
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   180
            text := collectedLines
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   181
        ].    
23777
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   182
        optionalTitle notNil ifTrue:[
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   183
            Dialog warn:text title:optionalTitle
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   184
        ] ifFalse:[    
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   185
            Dialog warn:text.
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   186
        ].
4500
be0fe7e7e21b Write to transcript if Dialog is not available.
Stefan Vogel <sv@exept.de>
parents: 4466
diff changeset
   187
    ] ifFalse:[
be0fe7e7e21b Write to transcript if Dialog is not available.
Stefan Vogel <sv@exept.de>
parents: 4466
diff changeset
   188
        "
be0fe7e7e21b Write to transcript if Dialog is not available.
Stefan Vogel <sv@exept.de>
parents: 4466
diff changeset
   189
         on systems without GUI, simply show
be0fe7e7e21b Write to transcript if Dialog is not available.
Stefan Vogel <sv@exept.de>
parents: 4466
diff changeset
   190
         the message on the Transcript.
be0fe7e7e21b Write to transcript if Dialog is not available.
Stefan Vogel <sv@exept.de>
parents: 4466
diff changeset
   191
        "
24023
d28afa3c1a06 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 23777
diff changeset
   192
        Transcript show:(self class name); show:': '; showCR:text.
4500
be0fe7e7e21b Write to transcript if Dialog is not available.
Stefan Vogel <sv@exept.de>
parents: 4466
diff changeset
   193
    ].
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   194
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   195
    "
7032
3c0246b4e602 Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents: 6427
diff changeset
   196
      Warning raiseRequestErrorString:' abc'
23777
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   197
      (Warning new title:'Alert') raiseRequestErrorString:' abc'
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   198
    "
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   199
23777
c1a7bebf28ab #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 19201
diff changeset
   200
    "Modified: / 03-08-1999 / 14:06:41 / stefan"
24096
98fa8c26986e #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 24023
diff changeset
   201
    "Modified: / 30-04-2019 / 12:59:53 / Claus Gittinger"
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   202
! !
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   203
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   204
!Warning class methodsFor:'documentation'!
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   205
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   206
version
19201
b301ed05553d comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 17307
diff changeset
   207
    ^ '$Header$'
12083
079b2535924f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10517
diff changeset
   208
!
079b2535924f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10517
diff changeset
   209
079b2535924f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10517
diff changeset
   210
version_CVS
19201
b301ed05553d comment/format in: #iconInBrowserSymbol
Claus Gittinger <cg@exept.de>
parents: 17307
diff changeset
   211
    ^ '$Header$'
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   212
! !
7032
3c0246b4e602 Now Warning is a subclass of UserNotification.
Stefan Vogel <sv@exept.de>
parents: 6427
diff changeset
   213
16423
d14faa326453 class: Warning
Claus Gittinger <cg@exept.de>
parents: 12279
diff changeset
   214
4446
4da4e51fc1ab initial checkin
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   215
Warning initialize!