author | convert-repo |
Tue, 09 Aug 2016 03:35:30 +0000 | |
changeset 1178 | 3a6dad9479fd |
parent 825 | c38783bf0e2f |
permissions | -rw-r--r-- |
729 | 1 |
" |
2 |
Copyright (c) 2007-2010 Jan Vrany |
|
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
4 |
||
5 |
Permission is hereby granted, free of charge, to any person |
|
6 |
obtaining a copy of this software and associated documentation |
|
7 |
files (the 'Software'), to deal in the Software without |
|
8 |
restriction, including without limitation the rights to use, |
|
9 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
10 |
copies of the Software, and to permit persons to whom the |
|
11 |
Software is furnished to do so, subject to the following |
|
12 |
conditions: |
|
13 |
||
14 |
The above copyright notice and this permission notice shall be |
|
15 |
included in all copies or substantial portions of the Software. |
|
16 |
||
17 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
18 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
19 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
20 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
21 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
22 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
23 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
24 |
OTHER DEALINGS IN THE SOFTWARE. |
|
25 |
" |
|
388 | 26 |
"{ Package: 'stx:libsvn' }" |
2 | 27 |
|
28 |
"{ NameSpace: SVN }" |
|
29 |
||
30 |
ApplicationModel subclass:#Browser |
|
729 | 31 |
instanceVariableNames:'modelHolder selectionHolder singleSelectionHolder listHolder' |
2 | 32 |
classVariableNames:'' |
33 |
poolDictionaries:'' |
|
34 |
category:'SVN-UI-Browsers' |
|
35 |
! |
|
36 |
||
729 | 37 |
!Browser class methodsFor:'documentation'! |
38 |
||
39 |
copyright |
|
40 |
" |
|
41 |
Copyright (c) 2007-2010 Jan Vrany |
|
42 |
Copyright (c) 2009-2010 eXept Software AG |
|
43 |
||
44 |
Permission is hereby granted, free of charge, to any person |
|
45 |
obtaining a copy of this software and associated documentation |
|
46 |
files (the 'Software'), to deal in the Software without |
|
47 |
restriction, including without limitation the rights to use, |
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
49 |
copies of the Software, and to permit persons to whom the |
|
50 |
Software is furnished to do so, subject to the following |
|
51 |
conditions: |
|
52 |
||
53 |
The above copyright notice and this permission notice shall be |
|
54 |
included in all copies or substantial portions of the Software. |
|
55 |
||
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
63 |
OTHER DEALINGS IN THE SOFTWARE. |
|
64 |
||
65 |
" |
|
66 |
! ! |
|
2 | 67 |
|
68 |
!Browser class methodsFor:'instance creation'! |
|
69 |
||
70 |
on: aWorkingCopy |
|
71 |
||
72 |
^self new |
|
73 |
model: aWorkingCopy; |
|
74 |
yourself |
|
75 |
||
76 |
"Created: / 14-04-2008 / 11:09:20 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
77 |
! ! |
|
78 |
||
79 |
!Browser class methodsFor:'interface opening'! |
|
80 |
||
81 |
openOn: aWorkingCopy |
|
82 |
||
83 |
^(self on: aWorkingCopy) open |
|
84 |
||
85 |
"Created: / 14-04-2008 / 11:09:18 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
86 |
! ! |
|
87 |
||
729 | 88 |
!Browser class methodsFor:'others'! |
89 |
||
90 |
version_CVS |
|
825
c38783bf0e2f
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
729
diff
changeset
|
91 |
^ '$Header$' |
729 | 92 |
! ! |
93 |
||
2 | 94 |
!Browser class methodsFor:'plugIn spec'! |
95 |
||
96 |
aspectSelectors |
|
97 |
||
98 |
^ #( |
|
99 |
#model |
|
100 |
). |
|
101 |
||
102 |
"Created: / 12-04-2008 / 21:04:10 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
103 |
! ! |
|
104 |
||
105 |
!Browser methodsFor:'accessing'! |
|
106 |
||
107 |
model |
|
108 |
^self modelHolder value |
|
109 |
||
110 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog" |
|
111 |
"Created: / 12-04-2008 / 21:01:04 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
112 |
! |
|
113 |
||
114 |
model:aModel |
|
115 |
self modelHolder subjectChannel:aModel |
|
116 |
"aModel isValueModel |
|
117 |
ifTrue:[self modelHolder subjectChannel:aModel] |
|
118 |
ifFalse:[self modelHolder subject:aModel]." |
|
119 |
||
120 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog" |
|
121 |
"Created: / 12-04-2008 / 21:01:04 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
122 |
! |
|
123 |
||
124 |
selection |
|
125 |
||
126 |
^self selectionHolder value |
|
127 |
||
128 |
"Created: / 22-10-2008 / 11:30:03 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
129 |
! |
|
130 |
||
131 |
selection: selection |
|
132 |
||
133 |
^self selectionHolder value: selection |
|
134 |
||
135 |
"Created: / 22-10-2008 / 11:30:11 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
136 |
! ! |
|
137 |
||
729 | 138 |
!Browser methodsFor:'accessing - selection'! |
139 |
||
140 |
theSingleSelectedObject |
|
2 | 141 |
|
729 | 142 |
| sel selSize obj | |
143 |
sel := self selection. |
|
144 |
||
145 |
(sel isCollection and:[self isString not]) |
|
146 |
ifFalse:[^sel]. |
|
2 | 147 |
|
729 | 148 |
selSize := 0. |
149 |
obj := nil. |
|
150 |
sel do: |
|
151 |
[:each| |
|
152 |
selSize := selSize + 1. |
|
153 |
selSize > 1 ifTrue:[^nil]. |
|
154 |
obj := each]. |
|
155 |
^obj |
|
2 | 156 |
|
729 | 157 |
"Created: / 10-11-2009 / 11:12:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
158 |
"Modified: / 20-11-2009 / 19:54:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2 | 159 |
! ! |
160 |
||
161 |
!Browser methodsFor:'aspects'! |
|
162 |
||
163 |
hasSelectionHolder |
|
164 |
||
165 |
|holder| |
|
166 |
||
167 |
(holder := builder bindingAt:#hasSelectionHolder) isNil ifTrue:[ |
|
168 |
holder := (AspectAdaptor forAspect: #notEmptyOrNil) |
|
169 |
subjectChannel: self selectionHolder. |
|
170 |
builder aspectAt:#hasSelectionHolder put: holder |
|
171 |
]. |
|
172 |
^ holder. |
|
173 |
||
174 |
"Created: / 22-10-2008 / 11:34:36 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
175 |
"Modified: / 22-10-2008 / 12:38:47 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
176 |
! |
|
177 |
||
729 | 178 |
listHolder |
179 |
"return/create the 'listHolder' value holder (automatically generated)" |
|
180 |
||
181 |
listHolder isNil ifTrue:[ |
|
182 |
listHolder := ValueHolder new. |
|
183 |
]. |
|
184 |
^ listHolder |
|
185 |
||
186 |
"Modified: / 01-11-2009 / 16:57:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
187 |
! |
|
188 |
||
2 | 189 |
modelHolder |
190 |
^modelHolder ifNil:[ |
|
191 |
modelHolder := (AspectAdaptor subjectChannel:nil) |
|
192 |
forAspect:#value |
|
193 |
] |
|
194 |
||
195 |
"Modified: / 20-04-2005 / 18:59:28 / janfrog" |
|
196 |
"Created: / 12-04-2008 / 21:01:04 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
197 |
! |
|
198 |
||
199 |
selectionHolder |
|
729 | 200 |
"return/create the 'selectionHolder' value holder (automatically generated)" |
201 |
||
202 |
selectionHolder isNil ifTrue:[ |
|
203 |
selectionHolder := ValueHolder new. |
|
204 |
selectionHolder addDependent:self. |
|
2 | 205 |
]. |
729 | 206 |
^ selectionHolder |
2 | 207 |
! |
208 |
||
729 | 209 |
singleSelectionHolder |
210 |
"return/create the 'singleSelectionHolder' value holder (automatically generated)" |
|
211 |
||
212 |
singleSelectionHolder isNil ifTrue:[ |
|
213 |
singleSelectionHolder := ValueHolder new. |
|
214 |
]. |
|
215 |
^ singleSelectionHolder |
|
216 |
||
217 |
"Modified: / 10-11-2009 / 11:09:14 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2 | 218 |
! ! |
219 |
||
220 |
!Browser methodsFor:'change & update'! |
|
221 |
||
222 |
selectionChanged |
|
223 |
||
729 | 224 |
self singleSelectionHolder value: |
225 |
self theSingleSelectedObject |
|
2 | 226 |
|
227 |
"Created: / 22-10-2008 / 11:29:24 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
729 | 228 |
"Modified: / 10-11-2009 / 11:13:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
229 |
! |
|
230 |
||
231 |
update: aspect with: param from: sender |
|
232 |
||
233 |
sender == selectionHolder ifTrue:[^self selectionChanged]. |
|
234 |
^super update: aspect with: param from: sender |
|
235 |
||
236 |
"Created: / 10-11-2009 / 11:10:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2 | 237 |
! ! |
238 |
||
239 |
!Browser methodsFor:'initialization'! |
|
240 |
||
241 |
initialize |
|
242 |
||
243 |
super initialize. |
|
244 |
self createBuilder |
|
245 |
||
246 |
"Created: / 22-10-2008 / 12:37:14 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
247 |
! ! |
|
248 |
||
249 |
!Browser methodsFor:'queries'! |
|
250 |
||
251 |
hasSelection |
|
252 |
||
253 |
^self selection notEmptyOrNil |
|
254 |
||
255 |
"Created: / 22-10-2008 / 12:23:29 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
256 |
! ! |
|
257 |
||
258 |
!Browser class methodsFor:'documentation'! |
|
259 |
||
260 |
version |
|
825
c38783bf0e2f
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
729
diff
changeset
|
261 |
^ '$Header$' |
132 | 262 |
! |
263 |
||
264 |
version_SVN |
|
825
c38783bf0e2f
checkin to get version methods correct
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
729
diff
changeset
|
265 |
^ '§Id: SVN__Browser.st 363 2011-08-08 13:49:48Z vranyj1 §' |
2 | 266 |
! ! |