author | Patrik Svestka <patrik.svestka@gmail.com> |
Fri, 05 Nov 2021 14:28:53 +0100 | |
branch | jv |
changeset 19617 | 96a62e7ef902 |
parent 18532 | cccb41254edf |
permissions | -rw-r--r-- |
18532
cccb41254edf
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
12431
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
cccb41254edf
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
12431
diff
changeset
|
2 |
|
7926 | 3 |
" |
10034 | 4 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
5 |
Copyright (c) 2009-2010 eXept Software AG |
|
7926 | 6 |
|
10034 | 7 |
Permission is hereby granted, free of charge, to any person |
8 |
obtaining a copy of this software and associated documentation |
|
9 |
files (the 'Software'), to deal in the Software without |
|
10 |
restriction, including without limitation the rights to use, |
|
11 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
12 |
copies of the Software, and to permit persons to whom the |
|
13 |
Software is furnished to do so, subject to the following |
|
14 |
conditions: |
|
15 |
||
16 |
The above copyright notice and this permission notice shall be |
|
17 |
included in all copies or substantial portions of the Software. |
|
18 |
||
19 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
20 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
21 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
22 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
23 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
24 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
25 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
26 |
OTHER DEALINGS IN THE SOFTWARE. |
|
7926 | 27 |
" |
6660 | 28 |
"{ Package: 'stx:libtool' }" |
29 |
||
30 |
"{ NameSpace: Tools }" |
|
31 |
||
32 |
Object subclass:#MethodCategoryCache |
|
33 |
instanceVariableNames:'cachedMethodCategories lock' |
|
34 |
classVariableNames:'TheOneAndOnlyCache' |
|
35 |
poolDictionaries:'' |
|
36 |
category:'Interface-Browsers-New' |
|
37 |
! |
|
38 |
||
7926 | 39 |
!MethodCategoryCache class methodsFor:'documentation'! |
40 |
||
41 |
copyright |
|
42 |
" |
|
10034 | 43 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
44 |
Copyright (c) 2009-2010 eXept Software AG |
|
45 |
||
46 |
Permission is hereby granted, free of charge, to any person |
|
47 |
obtaining a copy of this software and associated documentation |
|
48 |
files (the 'Software'), to deal in the Software without |
|
49 |
restriction, including without limitation the rights to use, |
|
50 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
51 |
copies of the Software, and to permit persons to whom the |
|
52 |
Software is furnished to do so, subject to the following |
|
53 |
conditions: |
|
7926 | 54 |
|
10034 | 55 |
The above copyright notice and this permission notice shall be |
56 |
included in all copies or substantial portions of the Software. |
|
57 |
||
58 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
59 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
60 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
61 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
62 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
63 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
64 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
65 |
OTHER DEALINGS IN THE SOFTWARE. |
|
7926 | 66 |
" |
67 |
! ! |
|
6660 | 68 |
|
69 |
!MethodCategoryCache class methodsFor:'instance creation'! |
|
70 |
||
71 |
new |
|
72 |
TheOneAndOnlyCache isNil ifTrue:[ |
|
73 |
TheOneAndOnlyCache := self basicNew initialize. |
|
74 |
]. |
|
75 |
^ TheOneAndOnlyCache |
|
76 |
! ! |
|
77 |
||
78 |
!MethodCategoryCache methodsFor:'accessing'! |
|
79 |
||
80 |
allMethodCategories |
|
81 |
cachedMethodCategories isNil ifTrue:[ |
|
82 |
self updateCachedMethodCategories |
|
83 |
]. |
|
84 |
^ cachedMethodCategories |
|
85 |
! |
|
86 |
||
87 |
updateCachedMethodCategories |
|
88 |
lock critical:[ |
|
89 |
cachedMethodCategories := Set new. |
|
90 |
Smalltalk allBehaviorsDo:[:eachClass | |
|
91 |
cachedMethodCategories addAll:eachClass categories |
|
92 |
]. |
|
93 |
]. |
|
94 |
! ! |
|
95 |
||
96 |
!MethodCategoryCache methodsFor:'change & update'! |
|
97 |
||
98 |
update:something with:aParameter from:changedObject |
|
99 |
|removed| |
|
100 |
||
101 |
changedObject == Smalltalk ifTrue:[ |
|
102 |
something == #methodInClassRemoved ifTrue:[ |
|
103 |
cachedMethodCategories := nil. |
|
104 |
^ self. |
|
105 |
]. |
|
106 |
(something == #classOrganization) ifTrue:[ |
|
107 |
cachedMethodCategories := nil. |
|
108 |
^ self. |
|
109 |
]. |
|
110 |
(something == #methodCategoryAdded) ifTrue:[ |
|
7991 | 111 |
cachedMethodCategories notNil ifTrue:[ |
112 |
cachedMethodCategories add:(aParameter second). |
|
113 |
]. |
|
6660 | 114 |
^ self. |
115 |
]. |
|
116 |
(something == #methodCategoryRemoved) ifTrue:[ |
|
117 |
cachedMethodCategories := nil. |
|
118 |
^ self. |
|
119 |
]. |
|
120 |
(something == #methodCategoriesRemoved) ifTrue:[ |
|
7991 | 121 |
cachedMethodCategories := nil. |
122 |
"/ removed := aParameter second asSet. |
|
123 |
"/ Smalltalk allMethodsDo:[:m | |
|
124 |
"/ |mCat| |
|
125 |
"/ mCat := m category. |
|
126 |
"/ (removed includes:mCat) ifTrue:[ |
|
127 |
"/ removed remove:mCat. |
|
128 |
"/ removed isEmpty ifTrue:[^ self ]. |
|
129 |
"/ ]. |
|
130 |
"/ ]. |
|
131 |
"/ cachedMethodCategories removeAll:removed. |
|
6660 | 132 |
^ self. |
133 |
]. |
|
134 |
(something == #methodCategoryRenamed) ifTrue:[ |
|
135 |
cachedMethodCategories := nil. |
|
136 |
^ self. |
|
137 |
]. |
|
138 |
something == #methodInClass ifTrue:[ |
|
139 |
^ self. |
|
140 |
]. |
|
141 |
^ self. |
|
142 |
]. |
|
143 |
super update:something with:aParameter from:changedObject |
|
144 |
! ! |
|
145 |
||
146 |
!MethodCategoryCache methodsFor:'initialization'! |
|
147 |
||
148 |
initialize |
|
149 |
lock := Semaphore forMutualExclusion. |
|
150 |
Smalltalk addDependent:self. |
|
151 |
! ! |
|
152 |
||
153 |
!MethodCategoryCache class methodsFor:'documentation'! |
|
154 |
||
10034 | 155 |
version_CVS |
18532
cccb41254edf
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
12431
diff
changeset
|
156 |
^ '§Header: /cvs/stx/stx/libtool/Tools__MethodCategoryCache.st,v 1.4 2011/07/03 13:33:26 cg Exp §' |
10034 | 157 |
! |
158 |
||
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
159 |
version_HG |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
160 |
|
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
161 |
^ '$Changeset: <not expanded> $' |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
162 |
! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
163 |
|
10034 | 164 |
version_SVN |
12128
a7ff7d66ee85
Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12123
diff
changeset
|
165 |
^ '$Id: Tools__MethodCategoryCache.st 7854 2012-01-30 17:49:41Z vranyj1 $' |
12431
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
166 |
! ! |
9f0c59c742d5
Added LintRuleSettingsApplication and LintRuleEditDialog to define user-defined rule sets.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
167 |