Tools__LintRuleDetail.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 12 May 2016 08:33:55 +0200
branchjv
changeset 16571 cf319f2e56d0
parent 15843 1c2cf683dbd2
parent 16526 1510e5d4c2ad
child 17379 028adf14bc05
permissions -rw-r--r--
Merge
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10094
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
     2
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
     3
 Copyright (c) 2009-2010 eXept Software AG
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
10094
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
     5
 Permission is hereby granted, free of charge, to any person
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
     6
 obtaining a copy of this software and associated documentation
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
     7
 files (the 'Software'), to deal in the Software without
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
     8
 restriction, including without limitation the rights to use,
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
     9
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    10
 copies of the Software, and to permit persons to whom the
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    11
 Software is furnished to do so, subject to the following
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    12
 conditions:
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    13
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    14
 The above copyright notice and this permission notice shall be
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    15
 included in all copies or substantial portions of the Software.
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    16
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    17
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    18
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    19
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    20
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    21
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    22
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    23
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    24
 OTHER DEALINGS IN THE SOFTWARE.
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
"{ NameSpace: Tools }"
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
ApplicationModel subclass:#LintRuleDetail
14898
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
    31
	instanceVariableNames:'ruleHolder rationaleVisibleHolder rationalView
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
    32
		selectedMethodsHolder'
10480
51d36cce6bbe oops - merge error
Claus Gittinger <cg@exept.de>
parents: 10473
diff changeset
    33
	classVariableNames:''
51d36cce6bbe oops - merge error
Claus Gittinger <cg@exept.de>
parents: 10473
diff changeset
    34
	poolDictionaries:''
51d36cce6bbe oops - merge error
Claus Gittinger <cg@exept.de>
parents: 10473
diff changeset
    35
	category:'Interface-Lint'
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
!LintRuleDetail class methodsFor:'documentation'!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
copyright
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
"
10094
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    42
 Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    43
 Copyright (c) 2009-2010 eXept Software AG
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    44
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    45
 Permission is hereby granted, free of charge, to any person
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    46
 obtaining a copy of this software and associated documentation
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    47
 files (the 'Software'), to deal in the Software without
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    48
 restriction, including without limitation the rights to use,
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    49
 copy, modify, merge, publish, distribute, sublicense, and/or sell
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    50
 copies of the Software, and to permit persons to whom the
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    51
 Software is furnished to do so, subject to the following
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    52
 conditions:
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
10094
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    54
 The above copyright notice and this permission notice shall be
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    55
 included in all copies or substantial portions of the Software.
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    56
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    57
 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    58
 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    59
 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    60
 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    61
 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    62
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    63
 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
f3ac4623ee59 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 9999
diff changeset
    64
 OTHER DEALINGS IN THE SOFTWARE.
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
"
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
! !
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    68
!LintRuleDetail class methodsFor:'help specs'!
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    69
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    70
flyByHelpSpec
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    71
    "This resource specification was automatically generated
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    72
     by the UIHelpTool of ST/X."
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    73
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    74
    "Do not manually edit this!! If it is corrupted,
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    75
     the UIHelpTool may not be able to read the specification."
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    76
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    77
    "
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    78
     UIHelpTool openOnClass:Tools::LintRuleDetail    
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    79
    "
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    80
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    81
    <resource: #help>
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    82
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    83
    ^ super flyByHelpSpec addPairsFrom:#(
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    84
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    85
#ruleName
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    86
'Click to browse the lint rule'
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    87
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    88
)
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    89
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    90
    "Created: / 07-09-2011 / 04:08:11 / cg"
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    91
! !
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
    92
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
!LintRuleDetail class methodsFor:'interface specs'!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
windowSpec
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    "This resource specification was automatically generated
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
     by the UIPainter of ST/X."
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
    "Do not manually edit this!! If it is corrupted,
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
     the UIPainter may not be able to read the specification."
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
    "
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
     UIPainter new openOnClass:Tools::LintRuleDetail andSelector:#windowSpec
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
     Tools::LintRuleDetail new openInterface:#windowSpec
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
     Tools::LintRuleDetail open
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
    "
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    <resource: #canvas>
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
10500
vrany
parents: 10480
diff changeset
   110
    ^ 
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
     #(FullSpec
10500
vrany
parents: 10480
diff changeset
   112
        name: windowSpec
vrany
parents: 10480
diff changeset
   113
        window: 
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
       (WindowSpec
10500
vrany
parents: 10480
diff changeset
   115
          label: 'SmalllintRuleDetail'
vrany
parents: 10480
diff changeset
   116
          name: 'SmalllintRuleDetail'
vrany
parents: 10480
diff changeset
   117
          min: (Point 10 10)
vrany
parents: 10480
diff changeset
   118
          bounds: (Rectangle 0 0 560 300)
vrany
parents: 10480
diff changeset
   119
        )
vrany
parents: 10480
diff changeset
   120
        component: 
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
       (SpecCollection
10500
vrany
parents: 10480
diff changeset
   122
          collection: (
vrany
parents: 10480
diff changeset
   123
           (VerticalPanelViewSpec
vrany
parents: 10480
diff changeset
   124
              name: 'Panel'
vrany
parents: 10480
diff changeset
   125
              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
vrany
parents: 10480
diff changeset
   126
              horizontalLayout: fit
vrany
parents: 10480
diff changeset
   127
              verticalLayout: topSpaceFit
vrany
parents: 10480
diff changeset
   128
              horizontalSpace: 0
vrany
parents: 10480
diff changeset
   129
              verticalSpace: 0
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   130
              ignoreInvisibleComponents: true
10500
vrany
parents: 10480
diff changeset
   131
              component: 
vrany
parents: 10480
diff changeset
   132
             (SpecCollection
vrany
parents: 10480
diff changeset
   133
                collection: (
vrany
parents: 10480
diff changeset
   134
                 (ViewSpec
vrany
parents: 10480
diff changeset
   135
                    name: 'Label'
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   136
                    visibilityChannel: false
10500
vrany
parents: 10480
diff changeset
   137
                    component: 
vrany
parents: 10480
diff changeset
   138
                   (SpecCollection
vrany
parents: 10480
diff changeset
   139
                      collection: (
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   140
                       (LinkButtonSpec
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   141
                          name: 'Button1'
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   142
                          layout: (LayoutFrame 0 0 0 0 -150 1 30 0)
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   143
                          activeHelpKey: ruleName
10500
vrany
parents: 10480
diff changeset
   144
                          translateLabel: true
vrany
parents: 10480
diff changeset
   145
                          labelChannel: ruleNameAspect
vrany
parents: 10480
diff changeset
   146
                          adjust: left
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   147
                          model: browseLintRule
10500
vrany
parents: 10480
diff changeset
   148
                        )
vrany
parents: 10480
diff changeset
   149
                       (CheckBoxSpec
vrany
parents: 10480
diff changeset
   150
                          label: 'Show Rationale'
vrany
parents: 10480
diff changeset
   151
                          name: 'CheckBox1'
vrany
parents: 10480
diff changeset
   152
                          layout: (LayoutFrame -150 1 0 0 0 1 30 0)
vrany
parents: 10480
diff changeset
   153
                          model: rationaleVisibleHolder
vrany
parents: 10480
diff changeset
   154
                          translateLabel: true
vrany
parents: 10480
diff changeset
   155
                        )
vrany
parents: 10480
diff changeset
   156
                       )
vrany
parents: 10480
diff changeset
   157
                     
vrany
parents: 10480
diff changeset
   158
                    )
vrany
parents: 10480
diff changeset
   159
                    extent: (Point 560 30)
vrany
parents: 10480
diff changeset
   160
                  )
vrany
parents: 10480
diff changeset
   161
                 (HTMLViewSpec
vrany
parents: 10480
diff changeset
   162
                    name: 'Rationale'
vrany
parents: 10480
diff changeset
   163
                    level: 0
vrany
parents: 10480
diff changeset
   164
                    visibilityChannel: rationaleVisibleHolder
vrany
parents: 10480
diff changeset
   165
                    hasHorizontalScrollBar: true
vrany
parents: 10480
diff changeset
   166
                    hasVerticalScrollBar: true
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   167
                    backgroundColor: (Color 86.9993133440147 86.9993133440147 86.9993133440147)
10500
vrany
parents: 10480
diff changeset
   168
                    htmlText: ruleRationaleAspect
vrany
parents: 10480
diff changeset
   169
                    extent: (Point 560 270)
vrany
parents: 10480
diff changeset
   170
                    postBuildCallback: setupHTMLView:
vrany
parents: 10480
diff changeset
   171
                  )
vrany
parents: 10480
diff changeset
   172
                 )
vrany
parents: 10480
diff changeset
   173
               
vrany
parents: 10480
diff changeset
   174
              )
vrany
parents: 10480
diff changeset
   175
            )
vrany
parents: 10480
diff changeset
   176
           )
vrany
parents: 10480
diff changeset
   177
         
vrany
parents: 10480
diff changeset
   178
        )
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
      )
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
! !
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
!LintRuleDetail class methodsFor:'plugIn spec'!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
aspectSelectors
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
    "This resource specification was automatically generated
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
     by the UIPainter of ST/X."
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
    "Do not manually edit this. If it is corrupted,
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
     the UIPainter may not be able to read the specification."
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    "Return a description of exported aspects;
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
     these can be connected to aspects of an embedding application
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
     (if this app is embedded in a subCanvas)."
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    ^ #(
10663
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   196
        #ruleHolder
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   197
        #ruleRationaleAspect
14898
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   198
        #selectedMethodsHolder
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
      ).
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   201
    "Modified: / 01-03-2012 / 16:31:04 / cg"
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
! !
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   204
!LintRuleDetail methodsFor:'actions'!
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   205
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   206
browseLintRule
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   207
    |rule ruleClass sel|
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   208
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   209
    rule := self ruleHolder value.
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   210
    rule isNil ifTrue:[^ self].
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   211
    ruleClass := rule class.
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   212
    (ruleClass implements:#rationale) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   213
        sel := #rationale.
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   214
    ].
13014
64e77f92badd class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 11314
diff changeset
   215
    UserPreferences systemBrowserClass
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   216
       openInClass:ruleClass selector:sel
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   217
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   218
    "Created: / 07-09-2011 / 04:09:38 / cg"
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   219
! !
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   220
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
!LintRuleDetail methodsFor:'aspects'!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   223
rationaleVisibleHolder
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   224
    "return/create the 'rationaleVisibleHolder' value holder (automatically generated)"
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   225
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   226
    rationaleVisibleHolder isNil ifTrue:[
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   227
        rationaleVisibleHolder := ValueHolder with: true "false".
10500
vrany
parents: 10480
diff changeset
   228
        rationaleVisibleHolder addDependent:self.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   229
    ].
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   230
    ^ rationaleVisibleHolder
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   231
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   232
    "Modified: / 04-08-2011 / 21:39:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   233
    "Modified: / 01-03-2012 / 08:50:20 / cg"
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   234
!
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   235
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   236
rationaleVisibleHolder:something
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   237
    "set the 'rationaleVisibleHolder' value holder (automatically generated)"
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   238
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   239
    |oldValue newValue|
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   240
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   241
    rationaleVisibleHolder notNil ifTrue:[
10500
vrany
parents: 10480
diff changeset
   242
        oldValue := rationaleVisibleHolder value.
vrany
parents: 10480
diff changeset
   243
        rationaleVisibleHolder removeDependent:self.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   244
    ].
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   245
    rationaleVisibleHolder := something.
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   246
    rationaleVisibleHolder notNil ifTrue:[
10500
vrany
parents: 10480
diff changeset
   247
        rationaleVisibleHolder addDependent:self.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   248
    ].
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   249
    newValue := rationaleVisibleHolder value.
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   250
    oldValue ~~ newValue ifTrue:[
10500
vrany
parents: 10480
diff changeset
   251
        self update:#value with:newValue from:rationaleVisibleHolder.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   252
    ].
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   253
!
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   254
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
ruleHolder
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
    "return/create the 'ruleHolder' value holder (automatically generated)"
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
    ruleHolder isNil ifTrue:[
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   259
        ruleHolder := ValueHolder new.
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    ].
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
    ^ ruleHolder
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   262
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   263
    "Modified: / 01-03-2012 / 08:51:03 / cg"
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   266
ruleHolder:something
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
    "set the 'ruleHolder' value holder (automatically generated)"
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   269
    |oldValue newValue|
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   270
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   271
    ruleHolder notNil ifTrue:[
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   272
        oldValue := ruleHolder value.
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   273
        ruleHolder removeDependent:self.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   274
    ].
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   275
    ruleHolder := something.
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   276
    ruleHolder notNil ifTrue:[
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   277
        ruleHolder addDependent:self.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   278
    ].
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   279
    newValue := ruleHolder value.
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   280
    oldValue ~~ newValue ifTrue:[
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   281
        self update:#value with:newValue from:ruleHolder.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   282
    ].
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   283
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   284
    "Modified: / 01-03-2012 / 15:29:30 / cg"
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
ruleNameAspect
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
    <resource: #uiAspect>
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
    |holder|
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
    (holder := builder bindingAt:#ruleNameAspect) isNil ifTrue:[
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   293
        holder := BlockValue
10673
5e23775830ee changed: #ruleNameAspect
Claus Gittinger <cg@exept.de>
parents: 10672
diff changeset
   294
                    with:[:h | 
5e23775830ee changed: #ruleNameAspect
Claus Gittinger <cg@exept.de>
parents: 10672
diff changeset
   295
                        "/ h displayString , ' ' , (('[browse]' actionForAll:[ self browseLintRule]) colorizeAllWith:Color blue) 
16526
1510e5d4c2ad #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 15837
diff changeset
   296
                        (h ? '') displayString asActionLinkTo:[ self browseLintRule ] 
10673
5e23775830ee changed: #ruleNameAspect
Claus Gittinger <cg@exept.de>
parents: 10672
diff changeset
   297
                    ]
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   298
                    argument: self ruleHolder.
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   299
        builder aspectAt:#ruleNameAspect put:holder.
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
    ].
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
    ^ holder.
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    "Modified: / 05-02-2010 / 12:51:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   304
    "Modified: / 01-03-2012 / 08:44:23 / cg"
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
ruleRationaleAspect
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
    <resource: #uiAspect>
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
    |holder|
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
    (holder := builder bindingAt:#ruleRationaleAspect) isNil ifTrue:[
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   313
        "cannot use a BlockValue linked on the ruleHolder for the
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   314
         ruleRationaleAspect, because the ruleHolder maight be changed dynamically
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   315
         via the aspect-linking mechanism"
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   316
"/        holder := (AspectAdaptor forAspect: #rationale) subjectChannel: self ruleHolder.
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   317
        holder := '' asValue.
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   318
        builder aspectAt:#ruleRationaleAspect put:holder.
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
    ].
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
    ^ holder.
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
    "Modified: / 05-02-2010 / 12:51:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   323
    "Modified: / 01-03-2012 / 15:29:16 / cg"
14898
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   324
!
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   325
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   326
selectedMethodsHolder
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   327
    "return/create the 'selectedMethodsHolder' value holder (automatically generated)"
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   328
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   329
    selectedMethodsHolder isNil ifTrue:[
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   330
        selectedMethodsHolder := #() asValue.
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   331
        selectedMethodsHolder addDependent:self.
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   332
    ].
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   333
    ^ selectedMethodsHolder
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   334
!
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   335
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   336
selectedMethodsHolder:something
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   337
    "set the 'selectedMethodsHolder' value holder (automatically generated)"
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   338
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   339
    |oldValue newValue|
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   340
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   341
    selectedMethodsHolder notNil ifTrue:[
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   342
        oldValue := selectedMethodsHolder value.
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   343
        selectedMethodsHolder removeDependent:self.
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   344
    ].
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   345
    selectedMethodsHolder := something.
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   346
    selectedMethodsHolder notNil ifTrue:[
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   347
        selectedMethodsHolder addDependent:self.
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   348
    ].
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   349
    newValue := selectedMethodsHolder value.
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   350
    oldValue ~= newValue ifTrue:[
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   351
        self update:#value with:newValue from:selectedMethodsHolder.
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   352
    ].
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   353
! !
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   354
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   355
!LintRuleDetail methodsFor:'change & update'!
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   356
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   357
update:something with:aParameter from:changedObject
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   358
    "Invoked when an object that I depend upon sends a change notification."
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   359
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   360
    changedObject == ruleHolder ifTrue:[
10500
vrany
parents: 10480
diff changeset
   361
        self updateVisibility.
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   362
        self updateRule.
10500
vrany
parents: 10480
diff changeset
   363
         ^ self.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   364
    ].
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   365
    changedObject == rationaleVisibleHolder ifTrue:[
10500
vrany
parents: 10480
diff changeset
   366
        self updateVisibility.
vrany
parents: 10480
diff changeset
   367
         ^ self.
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   368
    ].
14898
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   369
    changedObject == selectedMethodsHolder ifTrue:[
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   370
        "/ cg: preparations to show method-specific text in rationale/detail
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   371
        "/ view. Not yet done...
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   372
    ].
c786afd145ce class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
   373
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   374
    super update:something with:aParameter from:changedObject
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   375
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   376
    "Modified: / 04-08-2011 / 21:31:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   377
    "Modified: / 01-03-2012 / 15:27:38 / cg"
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   378
!
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   379
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   380
updateRule
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   381
    "cannot use a BlockValue linked on the ruleHolder for the
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   382
     ruleRationaleAspect, because the ruleHolder maight be changed dynamically
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   383
     via the aspect-linking mechanism"
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   384
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   385
    |rule|
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   386
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   387
    rule := self ruleHolder value.
11314
2f70adb99ceb changed: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11306
diff changeset
   388
    self ruleRationaleAspect value: (rule isNil ifTrue:[''] ifFalse:[rule rationaleWithAnchor]).
11306
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   389
64efae786a2c added: #updateRule
Claus Gittinger <cg@exept.de>
parents: 11299
diff changeset
   390
    "Created: / 01-03-2012 / 15:28:18 / cg"
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   391
!
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   392
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   393
updateVisibility
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   394
10480
51d36cce6bbe oops - merge error
Claus Gittinger <cg@exept.de>
parents: 10473
diff changeset
   395
    self ruleHolder value notNil
10663
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   396
        ifTrue:[self show]
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   397
        ifFalse:[self hide].
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   398
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   399
    "Created: / 04-08-2011 / 16:39:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10663
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   400
    "Modified: / 04-09-2011 / 20:18:48 / cg"
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   401
! !
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   402
10500
vrany
parents: 10480
diff changeset
   403
!LintRuleDetail methodsFor:'initialization'!
vrany
parents: 10480
diff changeset
   404
vrany
parents: 10480
diff changeset
   405
setupHTMLView:aView
10671
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   406
    rationalView := aView.
15837
95f2b67f68e8 class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 14898
diff changeset
   407
    rationalView linkActionPerformer:self.
10500
vrany
parents: 10480
diff changeset
   408
    aView painter
10671
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   409
        leftMargin:20;
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   410
        topMargin:5.
10500
vrany
parents: 10480
diff changeset
   411
vrany
parents: 10480
diff changeset
   412
    "Created: / 04-08-2011 / 18:00:36 / cg"
vrany
parents: 10480
diff changeset
   413
! !
vrany
parents: 10480
diff changeset
   414
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   415
!LintRuleDetail methodsFor:'private'!
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   416
10671
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   417
heightWhenNotShowingRationale
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   418
    ^ 30
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   419
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   420
    "Created: / 07-09-2011 / 04:02:34 / cg"
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   421
!
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   422
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   423
heightWhenShowingRationale
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   424
    ^ 100
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   425
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   426
    "Created: / 07-09-2011 / 04:02:24 / cg"
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   427
!
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   428
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   429
hide
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   430
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   431
    self visibility: false height: 0
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   432
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   433
    "Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   434
!
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   435
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   436
show
10671
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   437
    self 
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   438
        visibility: true 
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   439
        height: (self rationaleVisibleHolder value 
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   440
                    ifTrue:[ self heightWhenShowingRationale ] 
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   441
                    ifFalse:[ self heightWhenNotShowingRationale ])
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   442
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   443
    "Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10671
cfa8293dbe9a class definition
Claus Gittinger <cg@exept.de>
parents: 10663
diff changeset
   444
    "Modified: / 07-09-2011 / 04:03:07 / cg"
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   445
!
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   446
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   447
visibility: visibility height: height
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   448
    | container list detail h |
10663
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   449
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   450
"/ cg: the whole conatiner-container access chains below is ugly - use a name to access components.
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   451
"/ and also: there is no layout in list, so the code does crash.
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   452
"/ I disabled the whole visibility stuff.
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   453
^ self.
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   454
10663
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   455
    (container := self window container) isNil ifTrue:[^self].
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   456
    h := visibility ifFalse:[0] ifTrue:[height].
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   457
10663
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   458
    container isVisible == visibility ifFalse: [
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   459
        container isVisible: visibility
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   460
    ].
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   461
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   462
    list := container container subViews first.
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   463
    detail := container container subViews second.
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   464
10663
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   465
    (list layout bottomOffset ~= height negated) ifTrue:[
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   466
        list layout: (list layout bottomOffset: height negated; yourself)
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   467
    ].
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   468
    (detail layout topOffset ~= height negated) ifTrue:[
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   469
        detail layout: (detail layout topOffset: height negated; yourself)
32e84728c885 comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents: 10500
diff changeset
   470
    ].
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   471
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   472
    "Created: / 11-03-2010 / 09:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11299
3e8397061396 fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents: 10673
diff changeset
   473
    "Modified: / 01-03-2012 / 10:35:51 / cg"
10480
51d36cce6bbe oops - merge error
Claus Gittinger <cg@exept.de>
parents: 10473
diff changeset
   474
! !
10473
4201cd16dc0b Improvements in SmallLint UI
vrany
parents: 10456
diff changeset
   475
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
!LintRuleDetail class methodsFor:'documentation'!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   478
version
15837
95f2b67f68e8 class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 14898
diff changeset
   479
    ^ '$Header$'
10672
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   480
!
Claus Gittinger <cg@exept.de>
parents: 10671
diff changeset
   481
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
version_CVS
15837
95f2b67f68e8 class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 14898
diff changeset
   483
    ^ '$Header$'
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
!
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   486
version_SVN
15837
95f2b67f68e8 class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 14898
diff changeset
   487
    ^ '$Id$'
9999
34dc468e5d27 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   488
! !
13014
64e77f92badd class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents: 11314
diff changeset
   489