UIHelpTool.st
author Claus Gittinger <cg@exept.de>
Mon, 18 May 1998 13:53:53 +0200
changeset 828 12090f74be53
parent 779 2ffa22f97d5d
child 832 2c5b61b168e8
permissions -rw-r--r--
care for non-existing directory
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     1
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     2
 COPYRIGHT (c) 1995 by eXept Software AG
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     3
              All Rights Reserved
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     4
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     5
 This software is furnished under a license and may be used
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     6
 only in accordance with the terms of that license and with the
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     8
 be provided or otherwise made available to, or used by, any
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
     9
 other person.  No title to or ownership of the software is
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    10
 hereby transferred.
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    11
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    12
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    13
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    14
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    15
ToolApplicationModel subclass:#UIHelpTool
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    16
	instanceVariableNames:'specClass specSelector dictionary dictionaries listSelection
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    17
		maxCharsPerLine modifiedHolder modified'
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    18
	classVariableNames:''
785417b6955d intitial checkin
ca
parents:
diff changeset
    19
	poolDictionaries:''
785417b6955d intitial checkin
ca
parents:
diff changeset
    20
	category:'Interface-UIPainter'
785417b6955d intitial checkin
ca
parents:
diff changeset
    21
!
785417b6955d intitial checkin
ca
parents:
diff changeset
    22
785417b6955d intitial checkin
ca
parents:
diff changeset
    23
!UIHelpTool class methodsFor:'documentation'!
785417b6955d intitial checkin
ca
parents:
diff changeset
    24
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    25
copyright
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    26
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    27
 COPYRIGHT (c) 1995 by eXept Software AG
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    28
              All Rights Reserved
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    29
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    30
 This software is furnished under a license and may be used
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    31
 only in accordance with the terms of that license and with the
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    33
 be provided or otherwise made available to, or used by, any
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    34
 other person.  No title to or ownership of the software is
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    35
 hereby transferred.
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    36
"
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    37
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    38
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    39
!
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    40
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    41
documentation
785417b6955d intitial checkin
ca
parents:
diff changeset
    42
"
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    43
    The Help Tool allows you to define help dictionaries for the widgets in
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
    44
    window applications. The tool are able to run stand alone or in other master 
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    45
    applications like the GUI Painter and the Menu Editor.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    46
    If the application responds to the selector #showHelp:aHelpText for:aView,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    47
    this selector is called by the widget's view when the mouse cursor moves over. 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    48
    If the application does not responds to that selector, and the activeHelp mode
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    49
    is enabled, an active help bubble is shown at the widget's view.
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    50
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    51
    [instance variables:]
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    52
        specClass       <Symbol>        class implementing the help spec
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    53
        specSelector    <Symbol>        selector returning the help spec
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    54
        dictionary      <Dictionary>    dictionary containing pairs of help keys/texts
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    55
        dictionaries    <Dictionary>    dictionary containing pairs of help spec classes/help dictionaries
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    56
        listSelection   <String>        current selected help key
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    57
        maxCharsPerLine <Integer>       maximum number of allowed characters per text line
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    58
        modifiedHolder  <ValueHolder>   value holder for setting as modified
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    59
        modified        <Boolean>       flag whether the help spec was modified
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    60
156
b332d7117c40 added copyrights
Claus Gittinger <cg@exept.de>
parents: 151
diff changeset
    61
    [author:]
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    62
        Claus Atzkern, eXept Software AG
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    63
        Thomas Zwick, eXept Software AG
148
785417b6955d intitial checkin
ca
parents:
diff changeset
    64
"
785417b6955d intitial checkin
ca
parents:
diff changeset
    65
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
    66
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    67
!UIHelpTool class methodsFor:'instance creation'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    68
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    69
openOnClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    70
    "opens a Help Tool on aClass"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    71
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    72
    "
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    73
     UIHelpTool openOnClass:self
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    74
    "
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    75
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    76
    UIHelpTool new openOnClass:aClass
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    77
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    78
! !
9b705e31d38e some cleans
tz
parents: 740
diff changeset
    79
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    80
!UIHelpTool class methodsFor:'constants'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    81
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    82
label
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
    83
    "returns the label; used if embedded as sub canvas in the GUI Painter or Menu Editor"
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
    84
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
    85
    ^'Help'
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    86
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
    87
151
ca
parents: 148
diff changeset
    88
!UIHelpTool class methodsFor:'help specs'!
ca
parents: 148
diff changeset
    89
ca
parents: 148
diff changeset
    90
helpSpec
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    91
    "This resource specification was automatically generated
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    92
     by the UIHelpTool of ST/X."
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    93
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    94
    "Do not manually edit this!! If it is corrupted,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    95
     the UIHelpTool may not be able to read the specification."
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
    96
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
    97
    "
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
    98
     UIHelpTool openOnClass:UIHelpTool    
292
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
    99
    "
af69e3e025a9 an empty selection is specified by 0
ca
parents: 286
diff changeset
   100
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   101
    <resource: #help>
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   102
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   103
    ^super helpSpec addPairsFrom:#(
151
ca
parents: 148
diff changeset
   104
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   105
#addHelpTextKey
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   106
'Adds the help text key to the help spec.'
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   107
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   108
#currentHelpTexts
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   109
'Selected help text key.'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   110
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   111
#deleteHelpTextKey
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   112
'Deletes the help text key from the help spec.'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   113
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   114
#fileLoad
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   115
'Opens a dialog for selecting and loading a help spec from a class.'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   116
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   117
#fileSave
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   118
'Saves current help spec.'
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   119
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   120
#helpTextView
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   121
'Shows the help text.'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   122
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   123
#listOfHelpSpecClasses
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   124
'List of the classes where help specs can be/are implemented.'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   125
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   126
#listOfHelpTexts
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   127
'List of the help text keys.'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   128
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   129
#removeHelpTextKey
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   130
'Removes the help text key from the widget.'
172
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
   131
10e8e0510baa helpSpec no longer under UIPainter
ca
parents: 156
diff changeset
   132
)
151
ca
parents: 148
diff changeset
   133
! !
ca
parents: 148
diff changeset
   134
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   135
!UIHelpTool class methodsFor:'interface specs'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   136
785417b6955d intitial checkin
ca
parents:
diff changeset
   137
windowSpec
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   138
    "This resource specification was automatically generated
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   139
     by the UIPainter of ST/X."
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   140
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   141
    "Do not manually edit this!! If it is corrupted,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   142
     the UIPainter may not be able to read the specification."
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   143
785417b6955d intitial checkin
ca
parents:
diff changeset
   144
    "
151
ca
parents: 148
diff changeset
   145
     UIPainter new openOnClass:UIHelpTool andSelector:#windowSpec
ca
parents: 148
diff changeset
   146
     UIHelpTool new openInterface:#windowSpec
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   147
     UIHelpTool open
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   148
    "
785417b6955d intitial checkin
ca
parents:
diff changeset
   149
785417b6955d intitial checkin
ca
parents:
diff changeset
   150
    <resource: #canvas>
785417b6955d intitial checkin
ca
parents:
diff changeset
   151
785417b6955d intitial checkin
ca
parents:
diff changeset
   152
    ^
785417b6955d intitial checkin
ca
parents:
diff changeset
   153
     
785417b6955d intitial checkin
ca
parents:
diff changeset
   154
       #(#FullSpec
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   155
          #window: 
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   156
           #(#WindowSpec
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   157
              #name: 'Help Tool'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   158
              #layout: #(#LayoutFrame 155 0 273 0 440 0 543 0)
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   159
              #label: 'Help Tool'
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   160
              #min: #(#Point 10 10)
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   161
              #max: #(#Point 1160 870)
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   162
              #bounds: #(#Rectangle 155 273 441 544)
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   163
              #usePreferredExtent: false
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   164
          )
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   165
          #component: 
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   166
           #(#SpecCollection
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   167
              #collection: 
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   168
               #(
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   169
                 #(#VariableVerticalPanelSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   170
                    #name: 'VariableVerticalPanel'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   171
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   172
                    #component: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   173
                     #(#SpecCollection
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   174
                        #collection: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   175
                         #(
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   176
                           #(#VariableHorizontalPanelSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   177
                              #name: 'VariableHorizontalPanel'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   178
                              #component: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   179
                               #(#SpecCollection
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   180
                                  #collection: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   181
                                   #(
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   182
                                     #(#SequenceViewSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   183
                                        #name: 'listOfHelpKeysView'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   184
                                        #activeHelpKey: #listOfHelpTexts
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   185
                                        #tabable: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   186
                                        #model: #listModel
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   187
                                        #hasHorizontalScrollBar: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   188
                                        #hasVerticalScrollBar: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   189
                                        #miniScrollerHorizontal: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   190
                                        #useIndex: false
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   191
                                        #sequenceList: #listChannel
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   192
                                    )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   193
                                     #(#ViewSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   194
                                        #name: 'Box'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   195
                                        #component: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   196
                                         #(#SpecCollection
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   197
                                            #collection: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   198
                                             #(
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   199
                                               #(#InputFieldSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   200
                                                  #name: 'helpKeyInputField'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   201
                                                  #layout: #(#LayoutFrame 0 0.0 29 0 0 1.0 51 0)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   202
                                                  #activeHelpKey: #currentHelpTexts
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   203
                                                  #tabable: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   204
                                                  #model: #listModel
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   205
                                                  #immediateAccept: false
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   206
                                              )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   207
                                               #(#SequenceViewSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   208
                                                  #name: 'listOfHelpSpecClassesView'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   209
                                                  #layout: #(#LayoutFrame 0 0.0 54 0 0 1.0 0 1.0)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   210
                                                  #activeHelpKey: #listOfHelpSpecClasses
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   211
                                                  #tabable: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   212
                                                  #model: #selectionOfHelpSpecClass
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   213
                                                  #hasHorizontalScrollBar: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   214
                                                  #hasVerticalScrollBar: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   215
                                                  #miniScrollerHorizontal: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   216
                                                  #miniScrollerVertical: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   217
                                                  #valueChangeSelector: #helpSpecClassSelected
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   218
                                                  #useIndex: false
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   219
                                                  #sequenceList: #listOfHelpSpecClasses
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   220
                                              )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   221
                                               #(#HorizontalPanelViewSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   222
                                                  #name: 'HorizontalPanel1'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   223
                                                  #layout: #(#LayoutFrame 0 0.0 2 0 0 1.0 26 0)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   224
                                                  #component: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   225
                                                   #(#SpecCollection
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   226
                                                      #collection: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   227
                                                       #(
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   228
                                                         #(#ActionButtonSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   229
                                                            #name: 'AddButton'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   230
                                                            #activeHelpKey: #addHelpTextKey
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   231
                                                            #label: 'Add'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   232
                                                            #tabable: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   233
                                                            #model: #doAdd
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   234
                                                            #extent: #(#Point 44 24)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   235
                                                        )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   236
                                                         #(#ActionButtonSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   237
                                                            #name: 'RemoveButton'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   238
                                                            #activeHelpKey: #removeHelpTextKey
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   239
                                                            #label: 'Remove'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   240
                                                            #tabable: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   241
                                                            #model: #doRemove
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   242
                                                            #extent: #(#Point 45 24)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   243
                                                        )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   244
                                                         #(#ActionButtonSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   245
                                                            #name: 'DeleteButton'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   246
                                                            #activeHelpKey: #deleteHelpTextKey
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   247
                                                            #label: 'Delete'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   248
                                                            #tabable: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   249
                                                            #model: #doDelete
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   250
                                                            #extent: #(#Point 45 24)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   251
                                                        )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   252
                                                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   253
                                                  )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   254
                                                  #horizontalLayout: #fit
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   255
                                                  #verticalLayout: #fit
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   256
                                                  #horizontalSpace: 3
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   257
                                                  #verticalSpace: 3
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   258
                                              )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   259
                                            )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   260
                                        )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   261
                                    )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   262
                                  )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   263
                              )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   264
                              #handles: #(#Any 0.5 1.0)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   265
                          )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   266
                           #(#TextEditorSpec
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   267
                              #name: 'helpTextView'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   268
                              #activeHelpKey: #helpTextView
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   269
                              #tabable: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   270
                              #hasHorizontalScrollBar: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   271
                              #hasVerticalScrollBar: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   272
                              #miniScrollerHorizontal: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   273
                              #miniScrollerVertical: true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   274
                          )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   275
                        )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   276
                    )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   277
                    #handles: #(#Any 0.5 1.0)
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   278
                )
785417b6955d intitial checkin
ca
parents:
diff changeset
   279
              )
785417b6955d intitial checkin
ca
parents:
diff changeset
   280
          )
785417b6955d intitial checkin
ca
parents:
diff changeset
   281
      )
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   282
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   283
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   284
windowSpecForStandAlone
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   285
    "This resource specification was automatically generated
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   286
     by the UIPainter of ST/X."
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   287
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   288
    "Do not manually edit this!! If it is corrupted,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   289
     the UIPainter may not be able to read the specification."
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   290
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   291
    "
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   292
     UIPainter new openOnClass:UIHelpTool andSelector:#windowSpecForStandAlone
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   293
     UIHelpTool new openInterface:#windowSpecForStandAlone
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   294
    "
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   295
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   296
    <resource: #canvas>
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   297
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   298
    ^
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   299
     
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   300
       #(#FullSpec
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   301
          #window: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   302
           #(#WindowSpec
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   303
              #name: 'Help Tool'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   304
              #layout: #(#LayoutFrame 191 0 334 0 660 0 663 0)
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   305
              #label: 'Help Tool'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   306
              #min: #(#Point 300 300)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   307
              #max: #(#Point 1152 900)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   308
              #bounds: #(#Rectangle 191 334 661 664)
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   309
              #menu: #menu
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   310
              #usePreferredExtent: false
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   311
          )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   312
          #component: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   313
           #(#SpecCollection
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   314
              #collection: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   315
               #(
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   316
                 #(#UISubSpecification
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   317
                    #name: 'windowSpec'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   318
                    #layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 -26 1.0)
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   319
                    #minorKey: #windowSpec
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   320
                )
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   321
                 #(#UISubSpecification
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   322
                    #name: 'windowSpecForInfoBar'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   323
                    #layout: #(#LayoutFrame 0 0 -24 1 0 1 0 1)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   324
                    #majorKey: #ToolApplicationModel
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   325
                    #minorKey: #windowSpecForInfoBar
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   326
                )
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   327
              )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   328
          )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   329
      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   330
! !
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   331
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   332
!UIHelpTool class methodsFor:'menu specs'!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   333
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   334
menu
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   335
    "This resource specification was automatically generated
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   336
     by the MenuEditor of ST/X."
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   337
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   338
    "Do not manually edit this!! If it is corrupted,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   339
     the MenuEditor may not be able to read the specification."
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   340
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   341
    "
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   342
     MenuEditor new openOnClass:UIHelpTool andSelector:#menu
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   343
     (Menu new fromLiteralArrayEncoding:(UIHelpTool menu)) startUp
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   344
    "
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   345
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   346
    <resource: #menu>
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   347
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   348
    ^
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   349
     
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   350
       #(#Menu
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   351
          
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   352
           #(
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   353
             #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   354
                #label: 'File'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   355
                #submenu: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   356
                 #(#Menu
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   357
                    
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   358
                     #(
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   359
                       #(#MenuItem
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   360
                          #label: 'Load'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   361
                          #value: #doLoad
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   362
                          #activeHelpKey: #fileLoad
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   363
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   364
                       #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   365
                          #label: '-'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   366
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   367
                       #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   368
                          #label: 'Save'
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   369
                          #value: #doSave
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   370
                          #activeHelpKey: #fileSave
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   371
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   372
                       #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   373
                          #label: '-'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   374
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   375
                       #(#MenuItem
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   376
                          #label: 'Exit'
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   377
                          #value: #closeRequest
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   378
                          #activeHelpKey: #fileExit
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   379
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   380
                    ) nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   381
                    nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   382
                )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   383
            )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   384
             #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   385
                #label: 'Edit'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   386
                #submenu: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   387
                 #(#Menu
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   388
                    
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   389
                     #(
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   390
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   391
                          #label: 'Add'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   392
                          #value: #doAdd
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   393
                          #activeHelpKey: #addHelpTextKey
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   394
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   395
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   396
                          #label: '-'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   397
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   398
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   399
                          #label: 'Delete'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   400
                          #value: #doDelete
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   401
                          #activeHelpKey: #deleteHelpTextKey
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   402
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   403
                    ) nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   404
                    nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   405
                )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   406
            )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   407
             #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   408
                #label: 'Help'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   409
                #startGroup: #right
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   410
                #submenu: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   411
                 #(#Menu
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   412
                    
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   413
                     #(
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   414
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   415
                          #label: 'Documentation'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   416
                          #value: #openHTMLDocument:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   417
                          #activeHelpKey: #helpHelpTool
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   418
                          #argument: 'tools/uipainter/HelpTool.html'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   419
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   420
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   421
                          #label: '-'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   422
                      )
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   423
                       #(#MenuItem
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   424
                          #label: 'Show Help Texts'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   425
                          #activeHelpKey: #helpShowHelp
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   426
                          #indication: #showHelp:
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   427
                      )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   428
                    ) nil
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   429
                    nil
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   430
                )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   431
            )
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   432
          ) nil
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   433
          nil
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   434
      )
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   435
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   436
785417b6955d intitial checkin
ca
parents:
diff changeset
   437
!UIHelpTool methodsFor:'accessing'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   438
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   439
dictionaries
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   440
    "returns the dictionary of the help dictionaries of the classes having help specs"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   441
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   442
    ^dictionaries
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   443
!
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   444
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   445
dictionaries:aDictionaryOfDictionaries
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   446
    "sets a dictionary of the help dictionaries of the classes having help specs"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   447
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   448
    (dictionaries := aDictionaryOfDictionaries) isNil ifTrue:[
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   449
        dictionaries := Dictionary new.
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   450
    ].
715
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   451
    self updateList.
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   452
!
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   453
151
ca
parents: 148
diff changeset
   454
dictionary
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   455
    "returns the dictionary of the selected class"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   456
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   457
    ^dictionary
710
8c968790c885 use same help dict if started from the gui painter
tz
parents: 704
diff changeset
   458
!
151
ca
parents: 148
diff changeset
   459
ca
parents: 148
diff changeset
   460
dictionary:aDictionary
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   461
    "sets dictionary of the selected class"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   462
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   463
    (dictionary := aDictionary) isNil ifTrue:[
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   464
        dictionary := Dictionary new.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   465
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   466
    self updateList
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   467
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   468
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   469
helpKey
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   470
    "returns the help key of selected help text"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   471
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   472
    listSelection size ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   473
        ^ listSelection asSymbol
151
ca
parents: 148
diff changeset
   474
    ].
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   475
    ^ nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   476
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   477
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   478
helpKey:aKey
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   479
    "sets the help key into the selection channel in order to show the help text"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   480
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   481
    |key|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   482
    aKey size ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   483
        key := aKey asString
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   484
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   485
    self listModel value:key
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   486
151
ca
parents: 148
diff changeset
   487
!
ca
parents: 148
diff changeset
   488
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   489
modified
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   490
    "returns whether the help tool was modified"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   491
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   492
    ^modified
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   493
!
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   494
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   495
modified: aBoolean
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   496
    "sets the help tool as modified"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   497
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   498
    modified := aBoolean
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   499
!
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   500
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   501
modifiedHolder:aValueHolder
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   502
    "sets the value holder to true in case of modifying attributes"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   503
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   504
    modifiedHolder notNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   505
        modifiedHolder removeDependent:self. 
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   506
    ].
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   507
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   508
    (modifiedHolder := aValueHolder) notNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   509
        modifiedHolder addDependent:self.
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   510
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   511
        self editTextView notNil ifTrue: [
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   512
            self editTextView modifiedChannel onChangeSend:#value to:[
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   513
                modifiedHolder notNil ifTrue:[
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   514
                    self editTextView modifiedChannel value ifTrue:[
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   515
                        modifiedHolder value:true
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   516
                    ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   517
                ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   518
            ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   519
        ]
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   520
    ]
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   521
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   522
715
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   523
!
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   524
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   525
specClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   526
    "returns the class on which the help tool works"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   527
715
7eebac822985 modified bug fixed
tz
parents: 710
diff changeset
   528
    ^specClass
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   529
! !
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   530
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   531
!UIHelpTool methodsFor:'aspects'!
785417b6955d intitial checkin
ca
parents:
diff changeset
   532
785417b6955d intitial checkin
ca
parents:
diff changeset
   533
listChannel
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   534
    "returns the value holder of the help texts"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   535
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   536
    |holder|
785417b6955d intitial checkin
ca
parents:
diff changeset
   537
    (holder := builder bindingAt:#listChannel) isNil ifTrue:[
354
a6de8821d3bf add & remove popUpMenu
Claus Gittinger <cg@exept.de>
parents: 339
diff changeset
   538
        builder aspectAt:#listChannel put:(holder :=  OrderedCollection new asValue).
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   539
    ].
785417b6955d intitial checkin
ca
parents:
diff changeset
   540
    ^ holder
785417b6955d intitial checkin
ca
parents:
diff changeset
   541
!
785417b6955d intitial checkin
ca
parents:
diff changeset
   542
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   543
listModel
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   544
    "returns the value holder of the help key"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   545
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   546
    |holder|
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   547
    (holder := builder bindingAt:#listModel) isNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   548
        holder := AspectAdaptor new subject:self; forAspect:#listSelection.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   549
        builder aspectAt:#listModel put:holder.
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   550
    ].
785417b6955d intitial checkin
ca
parents:
diff changeset
   551
    ^ holder
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   552
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   553
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   554
listOfHelpSpecClasses
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   555
    "returns the value holder of the specClass and its superclasses 
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   556
     which are subclasses of ApplicationModel"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   557
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   558
    |holder|       
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   559
    (holder := builder bindingAt:#listOfHelpSpecClasses) isNil ifTrue:[
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   560
        builder aspectAt:#listOfHelpSpecClasses put: (holder := List new)
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   561
    ].
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   562
    ^ holder
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   563
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   564
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   565
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   566
selectionOfHelpSpecClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   567
    "returns the value holder of the selected help spec class"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   568
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   569
    |holder|
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   570
    (holder := builder bindingAt:#selectionOfHelpSpecClass) isNil ifTrue:[
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   571
        builder aspectAt:#selectionOfHelpSpecClass put: (holder := ValueHolder new)
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   572
    ].
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   573
    ^ holder
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   574
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   575
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
   576
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   577
!UIHelpTool methodsFor:'building'!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   578
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   579
buildFromClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   580
    "reads the help dictionary from aClass and find remaining classes 
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   581
     'between' aClass and ApplicationModel" 
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   582
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   583
    modified := false.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   584
    specClass notNil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   585
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   586
    [   
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   587
        dictionary   := Dictionary new.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   588
        dictionaries := Dictionary new.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   589
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   590
    specClass  := self getHelpSpecClassFromClass:aClass.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   591
    (specClass isClass and: [specClass isLoaded])
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   592
    ifTrue: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   593
    [                                               
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   594
        (specClass class implements:specSelector) ifFalse:[
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   595
            dictionaries at: specClass name put: dictionary 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   596
        ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   597
        self listOfHelpSpecClasses contents:  (specClass withAllSuperclasses reverse collect: [:cls| cls name]).
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   598
        (self listOfHelpSpecClasses includes: #ApplicationModel)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   599
            ifTrue: [self listOfHelpSpecClasses removeAll: (ApplicationModel withAllSuperclasses collect: [:cls| cls name])].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   600
        self selectionOfHelpSpecClass value: specClass name.  
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   601
        (builder componentAt: #listOfHelpSpecClassesView) selection: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   602
                (self listOfHelpSpecClasses value indexOf: specClass name).
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   603
        self helpSpecClassSelected.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   604
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   605
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   606
    self updateList
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   607
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   608
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   609
buildFromClass: aClass andSelector: aSelector
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   610
    "sets aSelector and reads the help dictionary from aClass"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   611
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   612
    specSelector := aSelector.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   613
    self buildFromClass:aClass
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   614
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   615
! !
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   616
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   617
!UIHelpTool methodsFor:'callbacks'!
148
785417b6955d intitial checkin
ca
parents:
diff changeset
   618
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   619
helpSpecClassSelected
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   620
    "extracts the help dictionary from the selected class and make it current"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   621
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   622
    |clsName|
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   623
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   624
    clsName := self selectionOfHelpSpecClass value.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   625
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   626
    (dictionary := dictionaries at: clsName ifAbsent: nil) isNil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   627
    ifTrue:
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   628
    [        
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   629
        dictionary := dictionaries at: clsName put: (self extractHelpSpecForClass: (Smalltalk at: clsName))
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   630
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   631
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   632
    self updateList.
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   633
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   634
    listSelection notNil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   635
    ifTrue: 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   636
    [
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   637
        (dictionary keys includes: listSelection asSymbol)
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   638
            ifTrue: [(builder componentAt: #listOfHelpKeysView) selection: 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   639
                     (self listChannel value indexOf: (builder componentAt: #helpKeyInputField) contents)]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   640
            ifFalse: [(builder componentAt: #listOfHelpKeysView) selection: nil].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   641
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   642
    listSelection notNil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   643
    ifTrue: 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   644
    [
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   645
        self editTextView contents: (dictionary at: listSelection asSymbol ifAbsent: '')
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   646
    ]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   647
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   648
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   649
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   650
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   651
!UIHelpTool methodsFor:'help'!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   652
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   653
defaultInfoLabel
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   654
    "returns the default label for the info bar"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   655
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   656
    specClass isClass
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   657
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   658
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   659
        (specClass class implements: specSelector)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   660
        ifFalse: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   661
        [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   662
            ^specSelector isNil 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   663
                ifTrue:  [specClass name, ' >> ? (no selector defined)']
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   664
                ifFalse: [specClass name, ' >> ', specSelector, ' (not implemented)']
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   665
        ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   666
        ^specClass name, ' >> ', specSelector
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   667
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   668
    ^'No class and selector defined.'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   669
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   670
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   671
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   672
! !
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   673
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   674
!UIHelpTool methodsFor:'private'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   675
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   676
askForModification
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   677
    "asks for modification"
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   678
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   679
    modified
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   680
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   681
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   682
        ((YesNoBox title: 'List was modified!!')        
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   683
            noText:'Cancel';
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   684
            yesText:'Waste it and proceed';
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   685
            showAtPointer;
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   686
            accepted) ifFalse: [^false].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   687
        modified := false
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   688
    ].
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   689
    ^true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   690
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   691
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   692
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   693
!
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   694
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   695
editTextView
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   696
    "returns the editTextView or nil"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   697
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   698
    |view|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   699
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   700
    (view := builder componentAt:#helpTextView) notNil ifTrue:[
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   701
        view := view scrolledView.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   702
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   703
        view acceptAction isNil ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   704
            view acceptAction:[:aList| self accept ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   705
        ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   706
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   707
        view left ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   708
            (maxCharsPerLine := view extent x // view font width) < 10 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   709
                maxCharsPerLine := nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   710
            ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   711
        ].
454
8b016ffd83ce set modified if help text accepted
tz
parents: 393
diff changeset
   712
    ].       
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   713
    ^ view
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   714
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   715
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   716
extractHelpSpecForClass: aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   717
    "extracts the help dictionary of aClass, it current and return it"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   718
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   719
    |helpSpecSuperClass superHelpSpecKeys helpSpec|
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   720
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   721
    ((aClass class implements: specSelector)
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   722
    and: [(helpSpecSuperClass := aClass allSuperclasses detect: [:cls| cls class implements: specSelector] ifNone: nil) notNil])
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   723
    ifTrue:
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   724
    [                  
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   725
        superHelpSpecKeys := helpSpecSuperClass helpSpec keys.
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   726
        helpSpec := Dictionary new.
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   727
        aClass helpSpec associationsDo:
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   728
        [:asso|
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   729
            (superHelpSpecKeys includes: asso key) ifFalse: [helpSpec at: asso key put: asso value]
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   730
        ].          
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   731
        ^dictionary := helpSpec
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   732
    ].
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   733
    ^dictionary := Dictionary new 
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   734
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   735
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   736
findHelpSpecForKey: aHelpKey
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   737
    "finds the help spec class including aHelpKey in its help dictionary and make it current"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   738
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   739
    |dictTemp|
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   740
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   741
    aHelpKey isNil ifTrue: [^nil].
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   742
    dictTemp := dictionary.
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   743
    self listOfHelpSpecClasses value do:
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   744
    [:clsName|            
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   745
        (dictionary := dictionaries at: clsName ifAbsent: nil) isNil
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   746
        ifTrue:
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   747
        [        
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   748
            dictionary := dictionaries at: clsName put: (self extractHelpSpecForClass: (Smalltalk at: clsName))
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   749
        ].
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   750
        (dictionary includesKey: aHelpKey asSymbol)  
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   751
        ifTrue:
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   752
        [            
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   753
            self updateList.
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   754
            ^(builder componentAt: #listOfHelpSpecClassesView) selection: 
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   755
                (self listOfHelpSpecClasses value indexOf: clsName).
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   756
        ]
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   757
    ].
700
2aae4f3b6526 supports merging into existing help specs
tz
parents: 696
diff changeset
   758
    dictionary := dictTemp
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   759
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   760
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   761
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   762
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   763
getHelpSpecClassFromClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   764
    "returns application class keeping the associated help text or nil"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   765
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   766
    |cls|
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   767
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   768
    ((cls := self resolveName:aClass) notNil and:[cls respondsTo: #helpSpecClass]) ifTrue:[
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   769
        ^cls helpSpecClass
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   770
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   771
    ^cls
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   772
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   773
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   774
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   775
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   776
getUnformattedHelpText: aHelpText
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   777
    "unformats aHelpText and returns it"
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   778
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   779
    |helpText|
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   780
    helpText := aHelpText asString replaceAll: Character cr with: Character space.
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   781
    (helpText endsWith:Character space) ifTrue:[
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   782
        helpText := helpText copyWithoutLast:1
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   783
    ].
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   784
    ^helpText
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   785
!
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   786
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   787
installHelpSpecOnClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   788
    "saves the help dicts in aClass which is subclass of ApplicationModel"
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   789
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   790
    |cls src helpSpec|
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   791
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   792
    cls := self getHelpSpecClassFromClass: aClass.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   793
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   794
    cls isNil ifTrue:[
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   795
        self information:'No application class defined!!'.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   796
        ^nil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   797
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   798
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   799
    (cls isSubclassOf: ApplicationModel) ifFalse:[
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   800
        self information: 'Cannot save help spec into class ', cls name asBoldText, ',\because it is not a subclass of ApplicationModel!!' withCRs.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   801
        ^nil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   802
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   803
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   804
    helpSpec := dictionaries 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   805
        at: cls name 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   806
        ifAbsent: [specClass notNil 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   807
            ifTrue:  [dictionaries at: aClass put: (self extractHelpSpecForClass: (Smalltalk at: aClass))]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   808
            ifFalse: [dictionary size > 0 ifTrue: [dictionary] ifFalse: [Dictionary new]]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   809
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   810
    helpSpec associationsDo:
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   811
    [:h|
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   812
        helpSpec at: h key put: (self getUnformattedHelpText: h value)
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   813
    ].
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   814
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   815
    (cls class implements: specSelector) 
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   816
    ifTrue: 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   817
    [
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   818
        |superclassHelpKeys implementedHelpSpec hasChanged|
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   819
        implementedHelpSpec := Dictionary new.
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   820
        superclassHelpKeys := (cls superclass respondsTo: specSelector)
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   821
            ifTrue:  [cls superclass helpSpec keys]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   822
            ifFalse: [Array new].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   823
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   824
        cls helpSpec associationsDo: [:h| (superclassHelpKeys includes: h key) 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   825
            ifFalse: [implementedHelpSpec at: h key put: h value]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   826
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   827
        hasChanged := false.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   828
        implementedHelpSpec associationsDo: [:h| (helpSpec            includesAssociation: h) ifFalse: [hasChanged := true]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   829
        helpSpec            associationsDo: [:h| (implementedHelpSpec includesAssociation: h) ifFalse: [hasChanged := true]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   830
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   831
        (implementedHelpSpec notEmpty and: [hasChanged and:
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   832
        [DialogBox confirm: 'Class ', cls name asBoldText, ' already implements\a help spec!!\\Do only replace, if you have removed\help keys in an existing help spec.\' withCRs yesLabel: ' Merge ' noLabel: ' Replace ']])
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   833
        ifTrue:
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   834
        [      
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   835
             implementedHelpSpec associationsDo: [:h| (helpSpec includesKey: h key) 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   836
                ifFalse: [helpSpec at: h key put: h value]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   837
        ]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   838
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   839
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   840
    helpSpec isEmpty ifTrue:[
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   841
        ^(cls superclass respondsTo: specSelector) ifTrue: [cls class removeSelector: specSelector].
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   842
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   843
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   844
    src  := '' writeStream.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   845
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   846
    src nextPutAll:
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   847
        specSelector, '\' withCRs,
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   848
        (ResourceSpecEditor codeGenerationCommentForClass: UIHelpTool) withCRs,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   849
    '\\' withCRs,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   850
    '    "\' withCRs,
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   851
    '     UIHelpTool openOnClass:', cls name asString ,'    
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   852
    "
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   853
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   854
    <resource: #help>
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   855
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   856
    ^super ', specSelector, ' addPairsFrom:#(
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   857
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   858
'.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   859
761
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   860
    helpSpec keys asSortedCollection do:
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   861
    [:key|
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   862
        src nextPutLine: key storeString.
91e524583390 do not save, if help texts have not changed (unformatting)
tz
parents: 750
diff changeset
   863
        src nextPutLine: (helpSpec at: key) storeString; cr.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   864
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   865
    src nextPutLine:')'.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   866
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   867
    Compiler 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   868
        compile:(src contents)
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   869
        forClass:cls class 
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   870
        inCategory:'help specs'.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   871
!
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   872
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   873
installHelpSpecsOnClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   874
    "saves the help dicts on aClass and its superclasses which are subclasses of ApplicationModel"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   875
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   876
    |cls helpSpecClasses|
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   877
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   878
    cls := self getHelpSpecClassFromClass:aClass.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   879
    cls isNil ifTrue: [^self information:'No application class defined!!'].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   880
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   881
    modified ifFalse:[
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   882
        masterApplication isNil ifTrue: [self information:'Nothing was modified!!'].
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   883
        ^nil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   884
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   885
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   886
    (helpSpecClasses := self listOfHelpSpecClasses value) notNil
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   887
    ifTrue:
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   888
    [        
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   889
        (helpSpecClasses includes: cls name) ifFalse: [helpSpecClasses add: cls name].
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   890
        helpSpecClasses do: [:clsName| (self installHelpSpecOnClass: clsName) isNil ifTrue: [^modified := false]].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   891
    ]
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   892
    ifFalse:
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   893
    [      
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   894
        self installHelpSpecOnClass: cls
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   895
    ].
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   896
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   897
    modified := false.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   898
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   899
!
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   900
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   901
resourceMessage: aString
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   902
    "extracts from aString the specClass and the specSelector"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   903
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   904
    (aString notNil and: [self askForModification]) 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   905
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   906
    [            
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   907
        |msg cls sel|
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   908
        msg := aString asCollectionOfWords.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   909
        (msg size == 2 and:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   910
        [(cls := self resolveName:(msg at:1)) notNil])
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   911
        ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   912
        [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   913
            specClass := cls name.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   914
            specSelector := (msg at: 2) asSymbol.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   915
            ^true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   916
        ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   917
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   918
    ^false
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   919
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   920
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   921
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   922
updateList
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   923
    "updates the list channel from dictionary"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   924
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   925
    self listChannel value: dictionary keys asSortedCollection
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   926
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   927
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   928
!UIHelpTool methodsFor:'selection'!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   929
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   930
listSelection
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   931
    "returns current selection"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   932
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   933
    ^ listSelection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   934
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   935
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   936
listSelection:aSelection
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   937
    "sets current selection"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   938
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   939
    |txt view sel|
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   940
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   941
    aSelection isNil 
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   942
        ifTrue: [(builder componentAt: #listOfHelpKeysView) selection: nil]
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
   943
        ifFalse: [(dictionary includesKey: aSelection asSymbol) ifFalse: [self findHelpSpecForKey: aSelection]].
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   944
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   945
    aSelection isNumber ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   946
        aSelection ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   947
            sel := self listChannel value at:aSelection
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   948
        ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   949
    ] ifFalse:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   950
        aSelection size ~~ 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   951
            sel := aSelection withoutSeparators.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   952
            sel size == 0 ifTrue:[
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   953
                sel := nil
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   954
            ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   955
        ]
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   956
    ].
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   957
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   958
    listSelection = sel ifFalse:[
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   959
        listSelection := sel.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   960
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   961
        modifiedHolder notNil ifTrue:[
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   962
            modifiedHolder value:true.
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   963
        ].
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   964
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   965
        (view := self editTextView) notNil ifTrue:[
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   966
            listSelection notNil ifTrue:[
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   967
                txt := dictionary at:(listSelection asSymbol) ifAbsent:nil.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   968
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   969
                (txt isNil or:[maxCharsPerLine isNil]) ifFalse:[
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   970
                    txt := UIPainter convertString:(txt asString) maxLineSize:maxCharsPerLine skipLineFeed:false.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   971
                ]
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   972
            ]. 
459
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   973
            view contents:txt.
fb5b5ecf7e86 set modified if help text has changed
tz
parents: 456
diff changeset
   974
            view modified:false.
299
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   975
        ]
62009576ca33 checkin from browser
ca
parents: 292
diff changeset
   976
    ]
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   977
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   978
! !
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
   979
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   980
!UIHelpTool methodsFor:'startup / release'!
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   981
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
   982
closeRequest
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   983
    "asks for permission before closing"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   984
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   985
    (self masterApplication isNil and:[self askForModification]) ifTrue:[super closeRequest]
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   986
!
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   987
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   988
initialize
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   989
    "initializes instance variables"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
   990
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   991
    super initialize.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   992
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
   993
    specSelector := #helpSpec.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   994
    dictionary   := Dictionary new.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   995
    dictionaries := Dictionary new.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   996
    modified   := false.
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
   997
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   998
!
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
   999
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1000
loadFromMessage:aString
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1001
    "loads a help spec by evaluating aString"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1002
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1003
    (aString notNil and: [self askForModification]) 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1004
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1005
    [            
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1006
        |msg cls sel|
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1007
        msg := aString asCollectionOfWords.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1008
        (msg size == 2 and:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1009
        [(cls := self resolveName:(msg at:1)) notNil and:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1010
        [cls class implements: (sel := (msg at: 2) asSymbol)]])
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1011
        ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1012
        [               
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1013
            self buildFromClass: (specClass := cls name) andSelector: (specSelector := sel).
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1014
            ^true
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1015
        ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1016
    ].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1017
    ^false
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1018
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1019
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1020
696
e91402372900 popup menu replaced by a list + supporting of help specs from different classes
tz
parents: 479
diff changeset
  1021
openInterface:aSymbol
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1022
    "do not open as stand alone"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1023
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1024
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1025
   
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1026
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1027
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1028
openOnClass:aClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1029
    "opens the UIHelpTool on aClass"
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1030
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1031
    super openInterface: #windowSpecForStandAlone.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1032
    self masterApplication isNil ifTrue: [(builder componentAt: #RemoveButton) beInvisible].
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1033
    builder window label: 'Help Tool'.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1034
    self buildFromClass: aClass
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1035
! !
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1036
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1037
!UIHelpTool methodsFor:'user actions'!
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1038
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1039
accept
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1040
    "accepts the help text"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1041
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1042
    |view key txt list listChgd|   
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1043
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1044
    (listSelection size == 0 or:[(view := self editTextView) isNil]) ifFalse:[
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1045
        txt    := view contents asString.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1046
        key    := listSelection asSymbol.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1047
        list   := self listChannel value.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1048
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1049
        (listChgd := (dictionary at:key ifAbsent:nil) isNil) ifTrue:[
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1050
            list add:key.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1051
        ].             
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1052
        dictionary at:key put:txt.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1053
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1054
        listChgd ifTrue:[
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1055
            self updateList.
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1056
            (builder componentAt: #listOfHelpKeysView) selection: (list indexOf: key).
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1057
        ]. 
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1058
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1059
        modified := true.
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1060
        modifiedHolder notNil ifTrue: [modifiedHolder value:true]
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1061
    ]
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1062
!
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1063
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1064
doAdd
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1065
    "adds a help key"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1066
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1067
    |helpKey|
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1068
    (helpKey := (builder componentAt: #helpKeyInputField asSymbol) contents) size > 0
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1069
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1070
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1071
        self listModel value: helpKey.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1072
        self accept
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1073
    ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1074
    ifFalse:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1075
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1076
        self warn: 'First define a help key!!'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1077
    ]
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1078
!
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1079
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1080
doDelete
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1081
    "deletes the selected help key"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1082
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1083
    listSelection notNil
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1084
    ifTrue:
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1085
    [
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1086
        dictionary removeKey: listSelection asSymbol ifAbsent: nil.
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1087
        self doRemove.
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1088
        self updateList.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1089
        modified := true.
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1090
        modifiedHolder notNil ifTrue: [modifiedHolder value:true]
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1091
    ]
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1092
    ifFalse:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1093
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1094
        self warn: 'First select a help key!!'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1095
    ]
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1096
!
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1097
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1098
doLoad
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1099
    "opens a Resource Selection Browser in order to get a resource message"
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1100
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1101
    self loadFromMessage: 
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1102
        (ResourceSelectionBrowser
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1103
            request: 'Load Help Spec From Class'
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1104
            onSuperclass: nil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1105
            andClass: specClass
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1106
            andSelector: specSelector ? #help
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1107
            withResourceTypes: (Array with: #help)).
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1108
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1109
    self updateInfoLabel
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1110
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1111
!
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1112
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1113
doNew
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1114
    "resets the help tool"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1115
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1116
    specClass := listSelection := nil.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1117
    self dictionary: nil.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1118
    self dictionaries: nil.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1119
    self listOfHelpSpecClasses removeAll.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1120
    modified := false.
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1121
!
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1122
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1123
doReload
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1124
    "reloads the help dictionaries"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1125
286
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1126
    |oldSel model|
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1127
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1128
    model  := self listModel.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1129
    oldSel := model value.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1130
    model value:nil.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1131
    self helpSpecFrom:specClass.
23712b1d3f3d checkin from browser
ca
parents: 261
diff changeset
  1132
    model value:oldSel.
740
e7362f3ab5e5 some bugs fixed
tz
parents: 722
diff changeset
  1133
    modified := false.
369
9d34f1ff4d29 support of lineFeed charaters
ca
parents: 354
diff changeset
  1134
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1135
!
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1136
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1137
doRemove
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1138
    "removes the selected help key"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1139
750
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1140
    listSelection notNil
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1141
    ifTrue:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1142
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1143
        self listModel value: nil.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1144
        self updateList.
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1145
        modifiedHolder notNil ifTrue: [modifiedHolder value:true]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1146
    ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1147
    ifFalse:
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1148
    [
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1149
        self warn: 'First select a help key!!'
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1150
    ]
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1151
!
9b705e31d38e some cleans
tz
parents: 740
diff changeset
  1152
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1153
doSave
779
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1154
    "saves the help dictionaries on specClass"
2ffa22f97d5d comments + documentation
tz
parents: 761
diff changeset
  1155
722
a1bb632b1e00 better save routine + help text added
tz
parents: 717
diff changeset
  1156
    self installHelpSpecsOnClass:specClass
148
785417b6955d intitial checkin
ca
parents:
diff changeset
  1157
! !
785417b6955d intitial checkin
ca
parents:
diff changeset
  1158
785417b6955d intitial checkin
ca
parents:
diff changeset
  1159
!UIHelpTool class methodsFor:'documentation'!
785417b6955d intitial checkin
ca
parents:
diff changeset
  1160
785417b6955d intitial checkin
ca
parents:
diff changeset
  1161
version
785417b6955d intitial checkin
ca
parents:
diff changeset
  1162
    ^ '$Header$'
785417b6955d intitial checkin
ca
parents:
diff changeset
  1163
! !