18310
|
1 |
"{ Encoding: utf8 }"
|
|
2 |
|
9975
|
3 |
"
|
10083
|
4 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
|
|
5 |
Copyright (c) 2009-2010 eXept Software AG
|
9975
|
6 |
|
10083
|
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.
|
9975
|
27 |
"
|
|
28 |
"{ Package: 'stx:libtool' }"
|
|
29 |
|
15226
|
30 |
"{ NameSpace: Smalltalk }"
|
|
31 |
|
9975
|
32 |
HierarchicalItem subclass:#Bookmark
|
|
33 |
instanceVariableNames:'label icon'
|
|
34 |
classVariableNames:''
|
|
35 |
poolDictionaries:''
|
|
36 |
category:'Interface-Bookmarks'
|
|
37 |
!
|
|
38 |
|
|
39 |
Bookmark subclass:#Class
|
|
40 |
instanceVariableNames:'className'
|
|
41 |
classVariableNames:''
|
|
42 |
poolDictionaries:''
|
|
43 |
privateIn:Bookmark
|
|
44 |
!
|
|
45 |
|
|
46 |
Bookmark subclass:#File
|
|
47 |
instanceVariableNames:'path'
|
|
48 |
classVariableNames:''
|
|
49 |
poolDictionaries:''
|
|
50 |
privateIn:Bookmark
|
|
51 |
!
|
|
52 |
|
|
53 |
Bookmark subclass:#Folder
|
|
54 |
instanceVariableNames:'name'
|
|
55 |
classVariableNames:''
|
|
56 |
poolDictionaries:''
|
|
57 |
privateIn:Bookmark
|
|
58 |
!
|
|
59 |
|
|
60 |
Bookmark subclass:#Method
|
|
61 |
instanceVariableNames:'className selector'
|
|
62 |
classVariableNames:''
|
|
63 |
poolDictionaries:''
|
|
64 |
privateIn:Bookmark
|
|
65 |
!
|
|
66 |
|
|
67 |
Bookmark::Folder subclass:#Recent
|
|
68 |
instanceVariableNames:'limit'
|
|
69 |
classVariableNames:''
|
|
70 |
poolDictionaries:''
|
|
71 |
privateIn:Bookmark
|
|
72 |
!
|
|
73 |
|
|
74 |
Bookmark subclass:#Separator
|
|
75 |
instanceVariableNames:''
|
|
76 |
classVariableNames:''
|
|
77 |
poolDictionaries:''
|
|
78 |
privateIn:Bookmark
|
|
79 |
!
|
|
80 |
|
|
81 |
Bookmark subclass:#URL
|
|
82 |
instanceVariableNames:'url'
|
|
83 |
classVariableNames:''
|
|
84 |
poolDictionaries:''
|
|
85 |
privateIn:Bookmark
|
|
86 |
!
|
|
87 |
|
|
88 |
!Bookmark class methodsFor:'documentation'!
|
|
89 |
|
|
90 |
copyright
|
|
91 |
"
|
10083
|
92 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
|
|
93 |
Copyright (c) 2009-2010 eXept Software AG
|
|
94 |
|
|
95 |
Permission is hereby granted, free of charge, to any person
|
|
96 |
obtaining a copy of this software and associated documentation
|
|
97 |
files (the 'Software'), to deal in the Software without
|
|
98 |
restriction, including without limitation the rights to use,
|
|
99 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
100 |
copies of the Software, and to permit persons to whom the
|
|
101 |
Software is furnished to do so, subject to the following
|
|
102 |
conditions:
|
9975
|
103 |
|
10083
|
104 |
The above copyright notice and this permission notice shall be
|
|
105 |
included in all copies or substantial portions of the Software.
|
|
106 |
|
|
107 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
108 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
109 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
110 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
111 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
112 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
113 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
114 |
OTHER DEALINGS IN THE SOFTWARE.
|
9975
|
115 |
"
|
|
116 |
! !
|
|
117 |
|
|
118 |
!Bookmark class methodsFor:'instance creation'!
|
|
119 |
|
|
120 |
forClass: aClass
|
|
121 |
|
|
122 |
^Bookmark::Class new className: aClass name
|
|
123 |
|
|
124 |
"
|
|
125 |
Bookmark forClass: Collection
|
|
126 |
"
|
|
127 |
|
|
128 |
"Created: / 05-05-2011 / 23:05:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
129 |
"Modified: / 23-05-2011 / 13:51:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
130 |
!
|
|
131 |
|
|
132 |
forClass: class selector: selector
|
|
133 |
|
|
134 |
^Bookmark::Method new className: class name selector: selector
|
|
135 |
|
|
136 |
"
|
|
137 |
Bookmark forMethod: Bookmark class >> #forMethod:
|
|
138 |
"
|
|
139 |
|
|
140 |
"Created: / 02-06-2011 / 23:21:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
141 |
!
|
|
142 |
|
|
143 |
forFile: aStringOrFilename
|
|
144 |
|
|
145 |
^Bookmark::File new path: aStringOrFilename asString
|
|
146 |
|
|
147 |
"
|
|
148 |
Bookmark forFile: '/etc/passwd'
|
|
149 |
"
|
|
150 |
|
|
151 |
"Created: / 20-06-2011 / 22:07:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
152 |
!
|
|
153 |
|
|
154 |
forFolderNamed: aString
|
|
155 |
|
|
156 |
^Bookmark::Folder new name: aString
|
|
157 |
|
|
158 |
"
|
|
159 |
Bookmark forClass: Collection
|
|
160 |
"
|
|
161 |
|
|
162 |
"Created: / 23-05-2011 / 10:02:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
163 |
!
|
|
164 |
|
|
165 |
forMethod: aMethod
|
|
166 |
|
|
167 |
^Bookmark::Method new className: aMethod mclass name selector: aMethod selector
|
|
168 |
|
|
169 |
"
|
|
170 |
Bookmark forMethod: Bookmark class >> #forMethod:
|
|
171 |
"
|
|
172 |
|
|
173 |
"Created: / 05-05-2011 / 23:05:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
174 |
"Modified: / 23-05-2011 / 13:49:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
175 |
!
|
|
176 |
|
|
177 |
forRecent
|
|
178 |
|
|
179 |
^Bookmark::Recent new
|
|
180 |
|
|
181 |
"
|
|
182 |
Bookmark forRecent
|
|
183 |
"
|
|
184 |
|
|
185 |
"Created: / 03-06-2011 / 10:50:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
186 |
!
|
|
187 |
|
|
188 |
forUrl: url label: label
|
|
189 |
|
|
190 |
^Bookmark::URL new url: url; label: label
|
|
191 |
|
|
192 |
"
|
|
193 |
Bookmark forClass: Collection
|
|
194 |
"
|
|
195 |
|
|
196 |
"Created: / 08-06-2011 / 12:44:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
197 |
!
|
|
198 |
|
|
199 |
separator
|
|
200 |
|
|
201 |
^Bookmark::Separator new
|
|
202 |
|
|
203 |
"
|
|
204 |
Bookmark forRecent
|
|
205 |
"
|
|
206 |
|
|
207 |
"Created: / 03-06-2011 / 13:39:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
208 |
! !
|
|
209 |
|
|
210 |
!Bookmark methodsFor:'accessing'!
|
|
211 |
|
|
212 |
/ label
|
|
213 |
|
|
214 |
self do:[:e|e label = label ifTrue:[^e]].
|
|
215 |
self error:'No child with label ''' , label , ''''.
|
|
216 |
|
|
217 |
"Created: / 21-06-2011 / 08:49:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
218 |
!
|
|
219 |
|
17885
|
220 |
helpText
|
15340
|
221 |
^ nil
|
|
222 |
!
|
|
223 |
|
9975
|
224 |
icon
|
18310
|
225 |
<resource: #programImage>
|
|
226 |
|
9975
|
227 |
"superclass BookmarkEntry says that I am responsible to implement this method"
|
|
228 |
|
10866
|
229 |
icon isNil ifTrue:[ self initializeIcon ].
|
9975
|
230 |
^ icon
|
|
231 |
|
|
232 |
"Created: / 05-05-2011 / 22:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10866
|
233 |
"Modified: / 18-11-2011 / 14:30:44 / cg"
|
18310
|
234 |
"Modified: / 30-07-2018 / 16:29:54 / Claus Gittinger"
|
9975
|
235 |
!
|
|
236 |
|
|
237 |
label
|
|
238 |
"superclass BookmarkEntry says that I am responsible to implement this method"
|
|
239 |
|
10866
|
240 |
label isNil ifTrue:[ self initializeLabel ].
|
|
241 |
^label isNil
|
|
242 |
ifTrue:[ self defaultLabel ]
|
|
243 |
ifFalse: [ label ].
|
9975
|
244 |
|
|
245 |
"Created: / 05-05-2011 / 22:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
246 |
"Modified: / 02-06-2011 / 11:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10866
|
247 |
"Modified (format): / 18-11-2011 / 14:31:05 / cg"
|
9975
|
248 |
!
|
|
249 |
|
18231
|
250 |
label:aStringOrText
|
9975
|
251 |
|
|
252 |
label := aStringOrText.
|
18231
|
253 |
self model changed:#label with:self
|
9975
|
254 |
|
|
255 |
"Created: / 02-06-2011 / 23:13:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
256 |
"Modified: / 03-06-2011 / 10:46:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
18231
|
257 |
"Modified (format): / 20-06-2018 / 12:44:02 / Claus Gittinger"
|
9975
|
258 |
! !
|
|
259 |
|
15228
|
260 |
!Bookmark methodsFor:'accessing-defaults'!
|
9975
|
261 |
|
|
262 |
defaultLabel
|
|
263 |
self subclassResponsibility
|
|
264 |
|
|
265 |
"Created: / 02-06-2011 / 11:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
266 |
! !
|
|
267 |
|
|
268 |
!Bookmark methodsFor:'basic adding & removing'!
|
|
269 |
|
|
270 |
basicAddAll:aList beforeIndex:anIndex
|
|
271 |
|
|
272 |
aList do:[:each|each parent: self].
|
|
273 |
^super basicAddAll:aList beforeIndex:anIndex
|
|
274 |
|
|
275 |
"Created: / 23-05-2011 / 14:10:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
276 |
! !
|
|
277 |
|
|
278 |
!Bookmark methodsFor:'change & update'!
|
|
279 |
|
18231
|
280 |
changed:aspect with:param
|
9975
|
281 |
| model |
|
|
282 |
|
18231
|
283 |
super changed:aspect with:param.
|
|
284 |
(model := self model) notNil ifTrue:[
|
|
285 |
model changed:aspect with:param
|
|
286 |
].
|
9975
|
287 |
|
|
288 |
"Created: / 23-05-2011 / 16:22:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
18231
|
289 |
"Modified (format): / 20-06-2018 / 12:43:54 / Claus Gittinger"
|
9975
|
290 |
! !
|
|
291 |
|
|
292 |
!Bookmark methodsFor:'converting'!
|
|
293 |
|
|
294 |
asMenu
|
|
295 |
|
10280
|
296 |
^self asMenuUsingBuilder: BookmarkToolbarMenuBuilder new
|
9975
|
297 |
|
|
298 |
"Created: / 23-05-2011 / 10:32:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
299 |
"Modified: / 21-06-2011 / 08:05:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10280
|
300 |
"Modified: / 08-07-2011 / 11:38:21 / cg"
|
9975
|
301 |
!
|
|
302 |
|
10280
|
303 |
asMenuUsingBuilder: builder
|
9975
|
304 |
|
10280
|
305 |
^builder buildMenuFor: self
|
9975
|
306 |
|
|
307 |
"Created: / 21-06-2011 / 08:04:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10280
|
308 |
"Modified (format): / 08-07-2011 / 11:37:19 / cg"
|
9975
|
309 |
! !
|
|
310 |
|
|
311 |
!Bookmark methodsFor:'encoding & decoding'!
|
|
312 |
|
|
313 |
skippedInLiteralEncoding
|
18336
|
314 |
"define the inst-slots which are skipped when generating a literalArrayEncoding;
|
|
315 |
(to skip the ones with default values.)"
|
9975
|
316 |
|
18321
|
317 |
^#(parent model isExpanded height width icon)
|
9975
|
318 |
|
|
319 |
"Created: / 05-05-2011 / 23:08:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
320 |
"Modified: / 02-06-2011 / 22:56:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
18321
|
321 |
"Modified: / 06-08-2018 / 15:15:20 / Stefan Vogel"
|
18336
|
322 |
"Modified (comment): / 09-08-2018 / 17:17:37 / Claus Gittinger"
|
9975
|
323 |
! !
|
|
324 |
|
|
325 |
!Bookmark methodsFor:'navigation'!
|
|
326 |
|
|
327 |
switchToBookmarkIn: application
|
|
328 |
|
|
329 |
application switchToBookmarkEntry: application
|
|
330 |
|
|
331 |
"Created: / 05-05-2011 / 23:47:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
332 |
! !
|
|
333 |
|
|
334 |
!Bookmark methodsFor:'printing & storing'!
|
|
335 |
|
|
336 |
printOn:aStream
|
16785
|
337 |
"append a printed representation of the receiver to the argument, aStream"
|
9975
|
338 |
|
|
339 |
aStream nextPutAll:'BKM['.
|
|
340 |
self label printOn: aStream.
|
|
341 |
aStream nextPut: $]
|
|
342 |
|
|
343 |
"Modified: / 02-06-2011 / 11:08:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
344 |
! !
|
|
345 |
|
|
346 |
!Bookmark methodsFor:'private'!
|
|
347 |
|
|
348 |
initializeIcon
|
|
349 |
"Created: / 05-05-2011 / 22:57:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
350 |
!
|
|
351 |
|
|
352 |
initializeLabel
|
|
353 |
|
|
354 |
label := '--------'
|
|
355 |
|
|
356 |
"Created: / 05-05-2011 / 22:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
357 |
"Modified: / 03-06-2011 / 13:45:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
358 |
! !
|
|
359 |
|
|
360 |
!Bookmark methodsFor:'testing'!
|
|
361 |
|
|
362 |
isClassBookmark
|
|
363 |
|
|
364 |
^false
|
|
365 |
|
|
366 |
"Created: / 05-05-2011 / 23:44:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
367 |
!
|
|
368 |
|
|
369 |
isFileBookmark
|
|
370 |
|
|
371 |
^false
|
|
372 |
|
|
373 |
"Created: / 20-06-2011 / 23:40:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
374 |
!
|
|
375 |
|
|
376 |
isFolderBookmark
|
|
377 |
|
|
378 |
^false
|
|
379 |
|
|
380 |
"Created: / 23-05-2011 / 09:59:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
381 |
!
|
|
382 |
|
|
383 |
isMethodBookmark
|
|
384 |
|
|
385 |
^false
|
|
386 |
|
|
387 |
"Created: / 05-05-2011 / 23:44:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
388 |
!
|
|
389 |
|
|
390 |
isRecentBookmark
|
|
391 |
|
|
392 |
^false
|
|
393 |
|
|
394 |
"Created: / 03-06-2011 / 10:50:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
395 |
!
|
|
396 |
|
|
397 |
isURLBookmark
|
|
398 |
|
|
399 |
^false
|
|
400 |
|
|
401 |
"Created: / 20-06-2011 / 23:40:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
402 |
! !
|
|
403 |
|
|
404 |
!Bookmark::Class methodsFor:'accessing'!
|
|
405 |
|
|
406 |
className
|
|
407 |
|
|
408 |
^className
|
|
409 |
|
|
410 |
"Created: / 05-05-2011 / 23:55:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
411 |
"Modified: / 23-05-2011 / 13:36:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
412 |
!
|
|
413 |
|
10260
|
414 |
className: aString
|
|
415 |
|
9975
|
416 |
className := aString.
|
|
417 |
|
10260
|
418 |
(className endsWith: ' class') ifTrue:[
|
10827
|
419 |
className := className copyTo: (className size - 6)"/ ' class' size - 1
|
10260
|
420 |
].
|
|
421 |
|
|
422 |
className := className asSymbol.
|
|
423 |
|
10827
|
424 |
"Modified: / 18-10-2011 / 13:33:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
15340
|
425 |
!
|
|
426 |
|
17885
|
427 |
helpText
|
15340
|
428 |
^ 'Goto ',className
|
9975
|
429 |
! !
|
|
430 |
|
15228
|
431 |
!Bookmark::Class methodsFor:'accessing-defaults'!
|
9975
|
432 |
|
|
433 |
defaultLabel
|
|
434 |
"superclass Bookmark says that I am responsible to implement this method"
|
|
435 |
|
|
436 |
^ 'Some Class...'
|
|
437 |
|
|
438 |
"Modified: / 02-06-2011 / 11:59:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
439 |
! !
|
|
440 |
|
|
441 |
!Bookmark::Class methodsFor:'comparing'!
|
|
442 |
|
|
443 |
= another
|
|
444 |
|
|
445 |
^(self class = another class)
|
|
446 |
and:[className = another className]
|
|
447 |
|
|
448 |
"Created: / 05-05-2011 / 23:33:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
449 |
"Modified: / 23-05-2011 / 13:59:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
450 |
!
|
|
451 |
|
|
452 |
hash
|
|
453 |
|
|
454 |
^className hash bitXor: self class hash
|
|
455 |
|
|
456 |
"Created: / 05-05-2011 / 23:32:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
457 |
"Modified: / 23-05-2011 / 13:59:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
458 |
! !
|
|
459 |
|
|
460 |
!Bookmark::Class methodsFor:'navigation'!
|
|
461 |
|
|
462 |
switchToBookmarkIn: application
|
|
463 |
|
13869
|
464 |
application switchToClass: (Smalltalk at: className asSymbol) selector: nil updateHistory: true
|
9975
|
465 |
|
|
466 |
"Created: / 05-05-2011 / 23:49:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
13869
|
467 |
"Modified: / 06-04-2012 / 10:59:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
9975
|
468 |
! !
|
|
469 |
|
|
470 |
!Bookmark::Class methodsFor:'private'!
|
|
471 |
|
|
472 |
initializeIcon
|
|
473 |
|
|
474 |
| cls |
|
10260
|
475 |
cls := Smalltalk at: className asSymbol.
|
10910
|
476 |
cls notNil ifTrue:[icon := SystemBrowser iconForClass: cls].
|
9975
|
477 |
|
|
478 |
"Created: / 05-05-2011 / 23:01:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10260
|
479 |
"Modified: / 30-06-2011 / 19:10:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10910
|
480 |
"Modified: / 29-11-2011 / 11:20:52 / cg"
|
9975
|
481 |
!
|
|
482 |
|
|
483 |
initializeLabel
|
|
484 |
|
10866
|
485 |
className isNil ifTrue:[^self].
|
9975
|
486 |
|
|
487 |
label := className copyFrom: (className lastIndexOf: $:) + 1
|
|
488 |
|
|
489 |
"Created: / 05-05-2011 / 23:03:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
490 |
"Modified: / 02-06-2011 / 11:57:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10866
|
491 |
"Modified: / 18-11-2011 / 14:31:11 / cg"
|
9975
|
492 |
! !
|
|
493 |
|
|
494 |
!Bookmark::Class methodsFor:'testing'!
|
|
495 |
|
|
496 |
isClassBookmark
|
|
497 |
|
|
498 |
^true
|
|
499 |
|
|
500 |
"Created: / 05-05-2011 / 23:44:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
501 |
! !
|
|
502 |
|
|
503 |
!Bookmark::Class methodsFor:'visiting'!
|
|
504 |
|
|
505 |
acceptVisitor:aVisitor
|
|
506 |
"Double dispatch back to the visitor, passing my type encoded in
|
|
507 |
the selector (visitor pattern)"
|
|
508 |
|
|
509 |
"stub code automatically generated - please change if required"
|
|
510 |
|
|
511 |
^ aVisitor visitClass:self
|
|
512 |
! !
|
|
513 |
|
|
514 |
!Bookmark::File methodsFor:'accessing'!
|
|
515 |
|
17885
|
516 |
helpText
|
15340
|
517 |
^ 'Goto "', path , '"'
|
|
518 |
!
|
|
519 |
|
9975
|
520 |
initializeLabel
|
|
521 |
|
|
522 |
label := path asFilename baseName
|
|
523 |
|
|
524 |
"Created: / 20-06-2011 / 22:09:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
525 |
!
|
|
526 |
|
|
527 |
path
|
|
528 |
^ path
|
|
529 |
!
|
|
530 |
|
|
531 |
path:something
|
|
532 |
path := something.
|
|
533 |
! !
|
|
534 |
|
15228
|
535 |
!Bookmark::File methodsFor:'accessing-defaults'!
|
9975
|
536 |
|
|
537 |
defaultLabel
|
|
538 |
"superclass Bookmark says that I am responsible to implement this method"
|
|
539 |
|
|
540 |
^ 'Some file...'
|
|
541 |
|
|
542 |
"Modified: / 20-06-2011 / 22:08:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
543 |
! !
|
|
544 |
|
|
545 |
!Bookmark::File methodsFor:'testing'!
|
|
546 |
|
|
547 |
isFileBookmark
|
|
548 |
|
|
549 |
^true
|
|
550 |
|
|
551 |
"Created: / 20-06-2011 / 23:40:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
552 |
! !
|
|
553 |
|
|
554 |
!Bookmark::File methodsFor:'visiting'!
|
|
555 |
|
|
556 |
acceptVisitor:aVisitor
|
|
557 |
"Double dispatch back to the visitor, passing my type encoded in
|
|
558 |
the selector (visitor pattern)"
|
|
559 |
|
|
560 |
"stub code automatically generated - please change if required"
|
|
561 |
|
|
562 |
^ aVisitor visitFile:self
|
|
563 |
! !
|
|
564 |
|
|
565 |
!Bookmark::Folder methodsFor:'accessing'!
|
|
566 |
|
|
567 |
initializeIcon
|
|
568 |
|
|
569 |
|
|
570 |
^ icon := ToolbarIconLibrary directoryOpen22x24Icon1
|
|
571 |
|
|
572 |
"Created: / 02-06-2011 / 12:10:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
573 |
!
|
|
574 |
|
|
575 |
initializeLabel
|
|
576 |
"superclass Bookmark says that I am responsible to implement this method"
|
|
577 |
|
|
578 |
^ label := self name
|
|
579 |
|
|
580 |
"Created: / 23-05-2011 / 14:08:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
581 |
"Modified: / 02-06-2011 / 11:52:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
582 |
!
|
|
583 |
|
|
584 |
label
|
|
585 |
|
|
586 |
^self name
|
|
587 |
|
|
588 |
"Created: / 02-06-2011 / 11:51:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
589 |
!
|
|
590 |
|
|
591 |
label: aString
|
|
592 |
|
|
593 |
self name: aString
|
|
594 |
|
|
595 |
"Created: / 03-06-2011 / 10:45:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
596 |
!
|
|
597 |
|
|
598 |
name
|
|
599 |
|
|
600 |
^name ? 'New Folder...'
|
|
601 |
|
|
602 |
"Created: / 23-05-2011 / 10:02:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
603 |
"Modified: / 02-06-2011 / 11:52:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
604 |
!
|
|
605 |
|
18231
|
606 |
name:aString
|
9975
|
607 |
|
|
608 |
name := aString.
|
18231
|
609 |
self model changed:#label with:self
|
9975
|
610 |
|
|
611 |
"Created: / 23-05-2011 / 10:02:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
612 |
"Modified: / 03-06-2011 / 10:46:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
18231
|
613 |
"Modified (format): / 20-06-2018 / 12:44:10 / Claus Gittinger"
|
9975
|
614 |
! !
|
|
615 |
|
15228
|
616 |
!Bookmark::Folder methodsFor:'accessing-defaults'!
|
9975
|
617 |
|
|
618 |
defaultLabel
|
|
619 |
"superclass Bookmark says that I am responsible to implement this method"
|
|
620 |
|
|
621 |
^ 'New Folder...'
|
|
622 |
|
|
623 |
"Modified: / 02-06-2011 / 11:58:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
624 |
! !
|
|
625 |
|
|
626 |
!Bookmark::Folder methodsFor:'testing'!
|
|
627 |
|
|
628 |
isFolderBookmark
|
|
629 |
|
|
630 |
^true
|
|
631 |
|
|
632 |
"Created: / 23-05-2011 / 10:00:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
633 |
! !
|
|
634 |
|
|
635 |
!Bookmark::Folder methodsFor:'utilities'!
|
|
636 |
|
|
637 |
moveDown: child
|
|
638 |
|
|
639 |
| index |
|
|
640 |
index := children identityIndexOf: child.
|
|
641 |
index = children size ifTrue:[^self].
|
|
642 |
self removeIndex: index.
|
|
643 |
self add: child afterIndex: index.
|
|
644 |
|
|
645 |
"Created: / 02-06-2011 / 11:04:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
646 |
!
|
|
647 |
|
|
648 |
moveIn: child
|
|
649 |
|
|
650 |
| index folder |
|
|
651 |
index := children identityIndexOf: child.
|
|
652 |
index = children size ifTrue:[^self].
|
|
653 |
folder := children at: index + 1.
|
|
654 |
folder isFolderBookmark ifFalse:[^self].
|
|
655 |
self removeIndex: index.
|
|
656 |
folder addFirst: child
|
|
657 |
|
|
658 |
"Created: / 03-06-2011 / 10:30:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
659 |
!
|
|
660 |
|
|
661 |
moveOut: child
|
|
662 |
|
|
663 |
| index myindex |
|
10866
|
664 |
self parent isNil ifTrue:[^self].
|
9975
|
665 |
index := children identityIndexOf: child.
|
|
666 |
myindex := self parent children identityIndexOf: self.
|
|
667 |
self removeIndex: index.
|
|
668 |
self parent add: child afterIndex: myindex.
|
|
669 |
|
|
670 |
"Created: / 03-06-2011 / 10:32:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10866
|
671 |
"Modified: / 18-11-2011 / 14:31:15 / cg"
|
9975
|
672 |
!
|
|
673 |
|
|
674 |
moveUp: child
|
|
675 |
|
|
676 |
| index |
|
|
677 |
index := children identityIndexOf: child.
|
|
678 |
index = 1 ifTrue:[^self].
|
|
679 |
self removeIndex: index.
|
|
680 |
self add: child beforeIndex: index - 1.
|
|
681 |
|
|
682 |
"Created: / 02-06-2011 / 11:04:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
14181
|
683 |
!
|
|
684 |
|
|
685 |
sortChildrenAlphabetically
|
|
686 |
self sort:[:a :b | a label < b label].
|
9975
|
687 |
! !
|
|
688 |
|
|
689 |
!Bookmark::Folder methodsFor:'visiting'!
|
|
690 |
|
|
691 |
acceptVisitor:aVisitor
|
|
692 |
"Double dispatch back to the visitor, passing my type encoded in
|
|
693 |
the selector (visitor pattern)"
|
|
694 |
|
|
695 |
"stub code automatically generated - please change if required"
|
|
696 |
|
|
697 |
^ aVisitor visitFolder:self
|
|
698 |
! !
|
|
699 |
|
|
700 |
!Bookmark::Method methodsFor:'accessing'!
|
|
701 |
|
|
702 |
className
|
|
703 |
|
|
704 |
^className
|
|
705 |
|
|
706 |
"Created: / 05-05-2011 / 23:55:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
707 |
"Modified: / 23-05-2011 / 13:36:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
708 |
!
|
|
709 |
|
|
710 |
className:aString
|
|
711 |
className := aString.
|
|
712 |
!
|
|
713 |
|
|
714 |
className:classNameArg selector:selectorArg
|
|
715 |
className := classNameArg.
|
|
716 |
selector := selectorArg.
|
|
717 |
!
|
|
718 |
|
17885
|
719 |
helpText
|
15340
|
720 |
^ className,' >> ',selector
|
|
721 |
!
|
|
722 |
|
9975
|
723 |
selector
|
|
724 |
^ selector
|
|
725 |
|
|
726 |
!
|
|
727 |
|
|
728 |
selector: aSymbol
|
|
729 |
selector := aSymbol
|
|
730 |
|
|
731 |
! !
|
|
732 |
|
15228
|
733 |
!Bookmark::Method methodsFor:'accessing-defaults'!
|
9975
|
734 |
|
|
735 |
defaultLabel
|
|
736 |
"superclass Bookmark says that I am responsible to implement this method"
|
|
737 |
|
|
738 |
^ 'Some Method...'
|
|
739 |
|
|
740 |
"Modified: / 02-06-2011 / 11:58:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
741 |
! !
|
|
742 |
|
|
743 |
!Bookmark::Method methodsFor:'navigation'!
|
|
744 |
|
|
745 |
switchToBookmarkIn: application
|
|
746 |
|
|
747 |
application
|
10116
|
748 |
switchToClass: (Smalltalk classNamed: className)
|
9975
|
749 |
selector: selector
|
13869
|
750 |
updateHistory: true
|
9975
|
751 |
|
|
752 |
"Created: / 05-05-2011 / 23:49:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10116
|
753 |
"Modified: / 03-07-2011 / 23:11:03 / cg"
|
13869
|
754 |
"Modified: / 06-04-2012 / 10:59:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
9975
|
755 |
! !
|
|
756 |
|
|
757 |
!Bookmark::Method methodsFor:'private'!
|
|
758 |
|
|
759 |
initializeLabel
|
|
760 |
|
10866
|
761 |
className isNil ifTrue:[^self].
|
|
762 |
selector isNil ifTrue:[^self].
|
9975
|
763 |
|
|
764 |
label :=
|
16036
|
765 |
(className copyFrom: ((className lastIndexOf: $:) + 1)) allBold ,
|
18310
|
766 |
' » ' , (selector "asText allItalic")
|
9975
|
767 |
|
|
768 |
"Created: / 05-05-2011 / 23:04:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
769 |
"Modified: / 02-06-2011 / 22:00:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10866
|
770 |
"Modified: / 18-11-2011 / 14:31:19 / cg"
|
9975
|
771 |
! !
|
|
772 |
|
|
773 |
!Bookmark::Method methodsFor:'testing'!
|
|
774 |
|
|
775 |
isMethodBookmark
|
|
776 |
|
|
777 |
^true
|
|
778 |
|
|
779 |
"Created: / 05-05-2011 / 23:44:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
780 |
! !
|
|
781 |
|
|
782 |
!Bookmark::Method methodsFor:'visiting'!
|
|
783 |
|
|
784 |
acceptVisitor:aVisitor
|
|
785 |
"Double dispatch back to the visitor, passing my type encoded in
|
|
786 |
the selector (visitor pattern)"
|
|
787 |
|
|
788 |
"stub code automatically generated - please change if required"
|
|
789 |
|
|
790 |
^ aVisitor visitMethod:self
|
|
791 |
! !
|
|
792 |
|
|
793 |
!Bookmark::Recent methodsFor:'accessing'!
|
|
794 |
|
|
795 |
limit
|
|
796 |
^ limit ? 15
|
|
797 |
|
|
798 |
"Modified: / 03-06-2011 / 10:51:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
799 |
!
|
|
800 |
|
|
801 |
limit:something
|
|
802 |
limit := something.
|
|
803 |
! !
|
|
804 |
|
|
805 |
!Bookmark::Recent methodsFor:'testing'!
|
|
806 |
|
|
807 |
isFolderBookmark
|
|
808 |
|
|
809 |
^false
|
|
810 |
|
|
811 |
"Created: / 03-06-2011 / 10:51:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
812 |
!
|
|
813 |
|
|
814 |
isRecentBookmark
|
|
815 |
|
|
816 |
^true
|
|
817 |
|
|
818 |
"Created: / 03-06-2011 / 10:51:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
819 |
! !
|
|
820 |
|
|
821 |
!Bookmark::Recent methodsFor:'visiting'!
|
|
822 |
|
|
823 |
acceptVisitor:aVisitor
|
|
824 |
"Double dispatch back to the visitor, passing my type encoded in
|
|
825 |
the selector (visitor pattern)"
|
|
826 |
|
|
827 |
"stub code automatically generated - please change if required"
|
|
828 |
|
|
829 |
^ aVisitor visitRecent:self
|
|
830 |
! !
|
|
831 |
|
|
832 |
!Bookmark::Separator methodsFor:'visiting'!
|
|
833 |
|
|
834 |
acceptVisitor:aVisitor
|
|
835 |
"Double dispatch back to the visitor, passing my type encoded in
|
|
836 |
the selector (visitor pattern)"
|
|
837 |
|
|
838 |
"stub code automatically generated - please change if required"
|
|
839 |
|
|
840 |
^ aVisitor visitSeparator:self
|
|
841 |
! !
|
|
842 |
|
|
843 |
!Bookmark::URL methodsFor:'accessing'!
|
|
844 |
|
17885
|
845 |
helpText
|
15340
|
846 |
^ 'Goto "', url asString , '"'
|
|
847 |
!
|
|
848 |
|
9975
|
849 |
url
|
|
850 |
^ url
|
|
851 |
!
|
|
852 |
|
|
853 |
url:aString
|
|
854 |
url := aString.
|
|
855 |
! !
|
|
856 |
|
|
857 |
!Bookmark::URL methodsFor:'comparing'!
|
|
858 |
|
|
859 |
= another
|
|
860 |
|
|
861 |
^(self class = another class)
|
|
862 |
and:[label = another label
|
|
863 |
and:[url = another url]].
|
|
864 |
|
|
865 |
"Created: / 08-06-2011 / 15:11:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
866 |
!
|
|
867 |
|
|
868 |
hash
|
|
869 |
|
|
870 |
^label asString hash bitXor:[url hash].
|
|
871 |
|
|
872 |
"Created: / 08-06-2011 / 15:10:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
873 |
! !
|
|
874 |
|
|
875 |
!Bookmark::URL methodsFor:'testing'!
|
|
876 |
|
|
877 |
isURLBookmark
|
|
878 |
|
|
879 |
^true
|
|
880 |
|
|
881 |
"Created: / 20-06-2011 / 23:40:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
882 |
! !
|
|
883 |
|
|
884 |
!Bookmark::URL methodsFor:'visiting'!
|
|
885 |
|
|
886 |
acceptVisitor:aVisitor
|
|
887 |
"Double dispatch back to the visitor, passing my type encoded in
|
|
888 |
the selector (visitor pattern)"
|
|
889 |
|
|
890 |
"stub code automatically generated - please change if required"
|
|
891 |
|
|
892 |
^ aVisitor visitURL:self
|
|
893 |
|
|
894 |
"Modified: / 16-06-2011 / 16:07:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
895 |
! !
|
|
896 |
|
|
897 |
!Bookmark class methodsFor:'documentation'!
|
|
898 |
|
15228
|
899 |
version
|
16036
|
900 |
^ '$Header$'
|
15228
|
901 |
!
|
|
902 |
|
9975
|
903 |
version_CVS
|
16036
|
904 |
^ '$Header$'
|
9975
|
905 |
!
|
|
906 |
|
|
907 |
version_SVN
|
16036
|
908 |
^ '$Id$'
|
9975
|
909 |
! !
|
13869
|
910 |
|