author | Claus Gittinger <cg@exept.de> |
Tue, 22 Sep 2009 10:22:40 +0200 | |
changeset 2749 | adec4c4c7874 |
parent 2614 | f916f680f75f |
child 2819 | 691218db6b3c |
permissions | -rw-r--r-- |
546 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
1482 | 12 |
"{ Package: 'stx:libview2' }" |
13 |
||
395 | 14 |
Object subclass:#DropObject |
860 | 15 |
instanceVariableNames:'theObject displayObject' |
395 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
875 | 18 |
category:'Interface-DragAndDrop' |
395 | 19 |
! |
20 |
||
403 | 21 |
DropObject class instanceVariableNames:'DisplayObject' |
22 |
||
23 |
" |
|
1482 | 24 |
No other class instance variables are inherited by this class. |
403 | 25 |
" |
26 |
! |
|
27 |
||
1482 | 28 |
DropObject subclass:#Class |
395 | 29 |
instanceVariableNames:'' |
30 |
classVariableNames:'' |
|
31 |
poolDictionaries:'' |
|
32 |
privateIn:DropObject |
|
33 |
! |
|
34 |
||
1277
ad8a630c9acd
try bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
1112
diff
changeset
|
35 |
DropObject subclass:#Color |
ad8a630c9acd
try bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents:
1112
diff
changeset
|
36 |
instanceVariableNames:'' |
860 | 37 |
classVariableNames:'' |
38 |
poolDictionaries:'' |
|
39 |
privateIn:DropObject |
|
40 |
! |
|
41 |
||
1482 | 42 |
DropObject subclass:#File |
43 |
instanceVariableNames:'info isHtmlFile isImageFile isPrintable' |
|
44 |
classVariableNames:'' |
|
45 |
poolDictionaries:'' |
|
46 |
privateIn:DropObject |
|
47 |
! |
|
48 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
49 |
DropObject::File subclass:#FileInArchive |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
50 |
instanceVariableNames:'' |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
51 |
classVariableNames:'' |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
52 |
poolDictionaries:'' |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
53 |
privateIn:DropObject |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
54 |
! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
55 |
|
395 | 56 |
DropObject subclass:#Image |
57 |
instanceVariableNames:'' |
|
58 |
classVariableNames:'' |
|
59 |
poolDictionaries:'' |
|
60 |
privateIn:DropObject |
|
61 |
! |
|
62 |
||
1482 | 63 |
DropObject subclass:#Method |
64 |
instanceVariableNames:'' |
|
65 |
classVariableNames:'' |
|
66 |
poolDictionaries:'' |
|
67 |
privateIn:DropObject |
|
68 |
! |
|
69 |
||
70 |
DropObject subclass:#Text |
|
71 |
instanceVariableNames:'' |
|
72 |
classVariableNames:'' |
|
73 |
poolDictionaries:'' |
|
74 |
privateIn:DropObject |
|
75 |
! |
|
76 |
||
546 | 77 |
!DropObject class methodsFor:'documentation'! |
78 |
||
79 |
copyright |
|
80 |
" |
|
81 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
82 |
All Rights Reserved |
|
83 |
||
84 |
This software is furnished under a license and may be used |
|
85 |
only in accordance with the terms of that license and with the |
|
86 |
inclusion of the above copyright notice. This software may not |
|
87 |
be provided or otherwise made available to, or used by, any |
|
88 |
other person. No title to or ownership of the software is |
|
89 |
hereby transferred. |
|
90 |
" |
|
91 |
||
92 |
||
93 |
! |
|
94 |
||
95 |
documentation |
|
96 |
" |
|
97 |
instances of myself and subclasses wrap objects which are being |
|
98 |
dragged (and dropped). |
|
99 |
Any object can be dragged, but for some often encountered types, |
|
100 |
specialized subclasses are provided, which react to certain queries. |
|
101 |
||
102 |
[see also:] |
|
103 |
DragAndDropManager |
|
104 |
||
105 |
[author:] |
|
106 |
Claus Atzkern |
|
107 |
" |
|
108 |
! ! |
|
395 | 109 |
|
110 |
!DropObject class methodsFor:'instance creation'! |
|
111 |
||
1112 | 112 |
dropObjectClassFor:someThing |
113 |
"given something to drag&drop, return an appropriate |
|
114 |
dropObject class for it." |
|
2590 | 115 |
|
116 |
"/ no, no visitor pattern here - I though about it and I think it sucks here. |
|
117 |
"/ reason: its al local and known here, which DropObjects I am willing to support. |
|
118 |
"/ addint double dispatch (acceptDropSourceVisitor:) adds a dependency to 6 other classes, |
|
119 |
"/ and worse: if I ever change my mind to allow for another one, I would have to change |
|
120 |
"/ that class as well (to add its (accept...) implementaion. |
|
121 |
"/ So, the typeSwitch below is OK. |
|
1112 | 122 |
|
2589 | 123 |
someThing isColor ifTrue:[^ DropObject::Color]. |
124 |
someThing isImageOrForm ifTrue:[^ DropObject::Image]. |
|
125 |
someThing isFilename ifTrue:[^ DropObject::File]. |
|
126 |
someThing isString ifTrue:[^ DropObject::Text]. |
|
127 |
someThing isBehavior ifTrue:[^ DropObject::Class]. |
|
128 |
someThing isMethod ifTrue:[^ DropObject::Method]. |
|
1112 | 129 |
^ self |
130 |
! |
|
131 |
||
395 | 132 |
new:someThing |
547 | 133 |
"create an instance on something |
395 | 134 |
" |
135 |
|cls| |
|
136 |
||
1112 | 137 |
cls := self dropObjectClassFor:someThing. |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
138 |
^ self newInstanceOf:cls for:someThing |
547 | 139 |
|
140 |
"Modified: 19.4.1997 / 17:19:55 / cg" |
|
395 | 141 |
! |
142 |
||
1482 | 143 |
newClass:aClass |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
144 |
"create an instance for a class (dragging a class from a browser)" |
1482 | 145 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
146 |
^ self newInstanceOf:DropObject::Class for:aClass |
1482 | 147 |
! |
148 |
||
395 | 149 |
newColor:aColor |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
150 |
"create an instance for a color (dragging a color from a bitmap editor)" |
547 | 151 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
152 |
^ self newInstanceOf:DropObject::Color for:aColor |
547 | 153 |
|
154 |
"Modified: 19.4.1997 / 17:20:17 / cg" |
|
395 | 155 |
! |
156 |
||
157 |
newFile:aFilename |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
158 |
"create an instance for a file or directory (dragging a file in a fileBrowser)" |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
159 |
|
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
160 |
^ self newInstanceOf:DropObject::File for:aFilename |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
161 |
! |
547 | 162 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
163 |
newFileInArchive:aFilename |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
164 |
"create an instance for a file or directory contained inside an archive |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
165 |
(dragging a file from an archive shown in a fileBrowser)" |
547 | 166 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
167 |
^ self newInstanceOf:DropObject::FileInArchive for:aFilename |
395 | 168 |
! |
169 |
||
170 |
newImage:anImageOrForm |
|
547 | 171 |
"create an instance for an image" |
172 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
173 |
^ self newInstanceOf:DropObject::Image for:anImageOrForm |
547 | 174 |
|
175 |
"Modified: 19.4.1997 / 17:20:37 / cg" |
|
395 | 176 |
! |
177 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
178 |
newInstanceOf:aClass for:someThing |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
179 |
"create an instance on something |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
180 |
" |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
181 |
^ aClass new theObject:someThing |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
182 |
|
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
183 |
"Modified: 19.4.1997 / 17:19:55 / cg" |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
184 |
! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
185 |
|
1482 | 186 |
newMethod:aMethod |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
187 |
"create an instance for a method (dragging a method in a browser)" |
1482 | 188 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
189 |
^ self newInstanceOf:DropObject::Method for:aMethod |
1482 | 190 |
! |
191 |
||
395 | 192 |
newText:aTextOrString |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
193 |
"create an instance for some text (dragging some text from an editor)" |
547 | 194 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
195 |
^ self newInstanceOf:DropObject::Text for:aTextOrString |
547 | 196 |
|
197 |
"Modified: 19.4.1997 / 17:20:46 / cg" |
|
395 | 198 |
! ! |
199 |
||
403 | 200 |
!DropObject class methodsFor:'defaults'! |
201 |
||
202 |
displayObject |
|
546 | 203 |
"return some object which is shown while dragging; |
204 |
here an image based upon my displayObjectName is returned. |
|
205 |
Either this method or #displayObjectName is usually redefined |
|
206 |
in subclasses" |
|
403 | 207 |
|
208 |
DisplayObject notNil ifTrue:[ |
|
209 |
^ DisplayObject |
|
210 |
]. |
|
1292 | 211 |
DisplayObject := Smalltalk imageFromFileNamed:(self displayObjectName) forClass:self. |
403 | 212 |
^ DisplayObject |
546 | 213 |
|
214 |
"Modified: 19.4.1997 / 13:04:05 / cg" |
|
215 |
! |
|
216 |
||
217 |
displayObject:aDisplayObject |
|
218 |
"set the object which is shown while dragging; |
|
219 |
this object must understand #displayOn:x:y: (i.e. the displayObject |
|
220 |
protocol). The object is kept per class for ALL future drag operations. |
|
221 |
Useful to change the default images in subclasses." |
|
222 |
||
223 |
DisplayObject := aDisplayObject |
|
224 |
||
225 |
"Modified: 19.4.1997 / 15:42:10 / cg" |
|
403 | 226 |
! |
227 |
||
228 |
displayObjectName |
|
546 | 229 |
"return the name of a bitmap image file, which is used |
230 |
during a drag. |
|
231 |
Here, a dummy file is returned." |
|
232 |
||
403 | 233 |
^ 'bitmaps/xpmBitmaps/plain_pixmaps/balloon3.xpm' |
234 |
||
546 | 235 |
"Modified: 19.4.1997 / 13:54:13 / cg" |
403 | 236 |
! ! |
237 |
||
395 | 238 |
!DropObject methodsFor:'accessing'! |
239 |
||
860 | 240 |
displayObject |
241 |
"return my graphical representation - here a default is returned" |
|
242 |
||
243 |
^ displayObject ? (self class displayObject) |
|
244 |
||
245 |
||
246 |
! |
|
247 |
||
248 |
displayObject:anObject |
|
249 |
"set my graphical representation" |
|
250 |
||
251 |
displayObject := anObject |
|
252 |
||
253 |
! |
|
254 |
||
395 | 255 |
theObject |
546 | 256 |
"return the real object represented by the receiver" |
395 | 257 |
|
546 | 258 |
^ theObject |
259 |
||
260 |
"Modified: 19.4.1997 / 12:53:01 / cg" |
|
261 |
! |
|
395 | 262 |
|
263 |
theObject:something |
|
546 | 264 |
"set the real object represented by the receiver" |
395 | 265 |
|
546 | 266 |
theObject := something. |
267 |
||
268 |
"Modified: 19.4.1997 / 12:53:10 / cg" |
|
269 |
! ! |
|
395 | 270 |
|
271 |
!DropObject methodsFor:'testing'! |
|
272 |
||
1482 | 273 |
isClassObject |
274 |
"return true, if the dropObject represents some class" |
|
275 |
||
276 |
^ false |
|
277 |
! |
|
278 |
||
395 | 279 |
isColorObject |
546 | 280 |
"return true, if the dropObject represents a color" |
281 |
||
395 | 282 |
^ false |
546 | 283 |
|
284 |
"Modified: 19.4.1997 / 12:52:36 / cg" |
|
395 | 285 |
! |
286 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
287 |
isFileInArchive |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
288 |
^ false |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
289 |
! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
290 |
|
395 | 291 |
isFileObject |
546 | 292 |
"return true, if the dropObject represents some file or directory" |
293 |
||
395 | 294 |
^ false |
546 | 295 |
|
296 |
"Modified: 19.4.1997 / 12:52:29 / cg" |
|
395 | 297 |
! |
298 |
||
299 |
isImageObject |
|
546 | 300 |
"return true, if the dropObject represents some image" |
301 |
||
395 | 302 |
^ false |
546 | 303 |
|
304 |
"Modified: 19.4.1997 / 12:52:22 / cg" |
|
395 | 305 |
! |
306 |
||
1482 | 307 |
isMethodObject |
308 |
"return true, if the dropObject represents some method" |
|
309 |
||
310 |
^ false |
|
311 |
! |
|
312 |
||
395 | 313 |
isTextObject |
546 | 314 |
"return true, if the dropObject represents some text" |
315 |
||
395 | 316 |
^ false |
546 | 317 |
|
318 |
"Modified: 19.4.1997 / 12:52:17 / cg" |
|
319 |
! ! |
|
320 |
||
2749 | 321 |
!DropObject::Class class methodsFor:'documentation'! |
322 |
||
323 |
documentation |
|
324 |
" |
|
325 |
I represent a class being dragged (from a browser's classList) |
|
326 |
" |
|
327 |
! ! |
|
328 |
||
1482 | 329 |
!DropObject::Class methodsFor:'testing'! |
330 |
||
331 |
isClassObject |
|
332 |
"return true, if the dropObject represents a class" |
|
333 |
||
334 |
^ true |
|
335 |
! ! |
|
336 |
||
337 |
!DropObject::Color class methodsFor:'defaults'! |
|
338 |
||
339 |
displayObjectName |
|
340 |
"return the name of a bitmap image file, which is used |
|
341 |
during a drag." |
|
342 |
||
343 |
^ 'bitmaps/xpmBitmaps/misc_tools/color_wheel.xpm' |
|
344 |
||
345 |
"Modified: 19.4.1997 / 15:38:12 / cg" |
|
346 |
! ! |
|
347 |
||
2749 | 348 |
!DropObject::Color class methodsFor:'documentation'! |
349 |
||
350 |
documentation |
|
351 |
" |
|
352 |
I represent a color being dragged (from an image editor) |
|
353 |
" |
|
354 |
! ! |
|
355 |
||
1482 | 356 |
!DropObject::Color methodsFor:'testing'! |
357 |
||
358 |
isColorObject |
|
359 |
"return true, if the dropObject represents a color" |
|
360 |
||
361 |
^ true |
|
362 |
||
363 |
"Modified: 19.4.1997 / 12:51:57 / cg" |
|
364 |
! ! |
|
365 |
||
403 | 366 |
!DropObject::File class methodsFor:'defaults'! |
367 |
||
368 |
displayObjectName |
|
546 | 369 |
"return the name of a bitmap image file, which is used |
370 |
during a drag." |
|
403 | 371 |
|
546 | 372 |
^ 'bitmaps/xpmBitmaps/document_images/xfm_file.xpm' |
403 | 373 |
|
546 | 374 |
"Modified: 19.4.1997 / 15:38:07 / cg" |
403 | 375 |
! ! |
376 |
||
2749 | 377 |
!DropObject::File class methodsFor:'documentation'! |
378 |
||
379 |
documentation |
|
380 |
" |
|
381 |
I represent a file being dragged (from a file browser) |
|
382 |
" |
|
383 |
! ! |
|
384 |
||
403 | 385 |
!DropObject::File methodsFor:'accessing'! |
386 |
||
387 |
theObject:aPathname |
|
546 | 388 |
|f path| |
403 | 389 |
|
546 | 390 |
f := aPathname asFilename. |
391 |
path := f pathName. |
|
392 |
info := f info. |
|
403 | 393 |
|
546 | 394 |
super theObject:f |
395 |
||
396 |
"Modified: 19.4.1997 / 12:49:17 / cg" |
|
403 | 397 |
! ! |
398 |
||
399 |
!DropObject::File methodsFor:'queries'! |
|
400 |
||
2253 | 401 |
asFilename |
402 |
^ theObject asString asFilename |
|
403 |
||
404 |
"Created: / 13-10-2006 / 17:22:24 / cg" |
|
405 |
! |
|
406 |
||
403 | 407 |
exists |
546 | 408 |
"returns true if the file or directory exists |
403 | 409 |
" |
410 |
^ info notNil |
|
546 | 411 |
|
412 |
"Modified: 19.4.1997 / 12:49:30 / cg" |
|
403 | 413 |
! |
414 |
||
415 |
isDirectory |
|
416 |
"checks whether file is a directory |
|
417 |
" |
|
418 |
^ (info notNil and:[info type == #directory]) |
|
419 |
! |
|
420 |
||
421 |
isHtmlFile |
|
546 | 422 |
"checks whether file is an html file |
403 | 423 |
" |
424 |
|suffixes pathName| |
|
425 |
||
426 |
isHtmlFile isNil ifTrue:[ |
|
427 |
(info isNil or:[self isDirectory]) ifTrue:[ |
|
428 |
isHtmlFile := false |
|
429 |
] ifFalse:[ |
|
430 |
pathName := theObject asString. |
|
431 |
suffixes := #( '.html' '.htm' '.HTML' '.HTM' ). |
|
432 |
isHtmlFile := (suffixes findFirst:[:el|pathName endsWith:el]) ~~ 0 |
|
433 |
] |
|
434 |
]. |
|
435 |
^ isHtmlFile |
|
546 | 436 |
|
437 |
"Modified: 19.4.1997 / 12:49:37 / cg" |
|
403 | 438 |
! |
439 |
||
440 |
isImageFile |
|
546 | 441 |
"returns true if file is an image file |
403 | 442 |
" |
546 | 443 |
|pathName| |
403 | 444 |
|
445 |
isImageFile isNil ifTrue:[ |
|
446 |
(info isNil or:[self isDirectory]) ifTrue:[ |
|
447 |
isImageFile := false |
|
448 |
] ifFalse:[ |
|
449 |
pathName := theObject asString. |
|
546 | 450 |
isImageFile := Image isImageFileSuffix:(pathName asFilename suffix). |
403 | 451 |
] |
452 |
]. |
|
453 |
^ isImageFile |
|
454 |
||
546 | 455 |
"Modified: 19.4.1997 / 12:50:58 / cg" |
403 | 456 |
! |
457 |
||
458 |
isPrintable |
|
2614 | 459 |
"return true if file contains only printable characters (in the first 300 bytes)" |
1952
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
460 |
|
2614 | 461 |
|nChars stream buff size| |
462 |
||
463 |
nChars := 300. |
|
403 | 464 |
|
465 |
isPrintable isNil ifTrue:[ |
|
466 |
isPrintable := false. |
|
1952
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
467 |
(info isNil or:[ self isDirectory ]) ifFalse:[ |
1709
fc33be8aaa9c
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
1623
diff
changeset
|
468 |
stream := theObject readStreamOrNil. |
fc33be8aaa9c
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
1623
diff
changeset
|
469 |
stream notNil ifTrue:[ |
2614 | 470 |
buff := String new:nChars. |
471 |
size := stream nextBytes:nChars into:buff. |
|
403 | 472 |
stream close. |
1952
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
473 |
1 to:size do:[:i | |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
474 |
(buff at:i) isPrintable ifFalse:[ |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
475 |
^ false |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
476 |
] |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
477 |
]. |
403 | 478 |
]. |
479 |
isPrintable := true |
|
480 |
] |
|
481 |
]. |
|
482 |
^ isPrintable |
|
483 |
! ! |
|
484 |
||
485 |
!DropObject::File methodsFor:'testing'! |
|
486 |
||
487 |
isFileObject |
|
546 | 488 |
"return true, if the dropObject represents a file- or directory" |
396 | 489 |
|
490 |
^ true |
|
491 |
||
546 | 492 |
"Modified: 19.4.1997 / 12:51:49 / cg" |
395 | 493 |
! ! |
494 |
||
2749 | 495 |
!DropObject::FileInArchive class methodsFor:'documentation'! |
496 |
||
497 |
documentation |
|
498 |
" |
|
499 |
I represent a file being dragged from inside an archive (tar, zip,...) (from a file browser) |
|
500 |
" |
|
501 |
! ! |
|
502 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
503 |
!DropObject::FileInArchive methodsFor:'testing'! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
504 |
|
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
505 |
isFileInArchive |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
506 |
^ true |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
507 |
! ! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
508 |
|
1292 | 509 |
!DropObject::Image class methodsFor:'defaults'! |
510 |
||
511 |
displayObjectName |
|
512 |
"return the name of a bitmap image file, which is used |
|
513 |
during a drag." |
|
514 |
||
515 |
^ 'bitmaps/xpmBitmaps/misc_tools/picture.xpm' |
|
516 |
||
517 |
"Modified: 19.4.1997 / 15:38:02 / cg" |
|
518 |
! ! |
|
519 |
||
2749 | 520 |
!DropObject::Image class methodsFor:'documentation'! |
521 |
||
522 |
documentation |
|
523 |
" |
|
524 |
I represent a bitmap image being dragged |
|
525 |
" |
|
526 |
! ! |
|
527 |
||
1292 | 528 |
!DropObject::Image methodsFor:'testing'! |
529 |
||
530 |
isImageObject |
|
531 |
"return true, if the dropObject represents an image" |
|
532 |
||
533 |
^ true |
|
534 |
||
535 |
"Modified: 19.4.1997 / 12:51:28 / cg" |
|
536 |
! ! |
|
537 |
||
2749 | 538 |
!DropObject::Method class methodsFor:'documentation'! |
539 |
||
540 |
documentation |
|
541 |
" |
|
542 |
I represent a method image being dragged (from a browser's methodlist) |
|
543 |
" |
|
544 |
! ! |
|
545 |
||
1482 | 546 |
!DropObject::Method methodsFor:'testing'! |
547 |
||
548 |
isMethodObject |
|
549 |
"return true, if the dropObject represents a method" |
|
550 |
||
551 |
^ true |
|
552 |
! ! |
|
553 |
||
554 |
!DropObject::Text class methodsFor:'defaults'! |
|
555 |
||
556 |
displayObjectName |
|
557 |
^ 'bitmaps/xpmBitmaps/document_images/yellow_file_text_grab.xpm' |
|
558 |
||
559 |
"Modified: 19.4.1997 / 15:40:33 / cg" |
|
560 |
! ! |
|
561 |
||
2749 | 562 |
!DropObject::Text class methodsFor:'documentation'! |
563 |
||
564 |
documentation |
|
565 |
" |
|
566 |
I represent text being dragged (via CTRL-drag from a textView) |
|
567 |
" |
|
568 |
! ! |
|
569 |
||
1482 | 570 |
!DropObject::Text methodsFor:'testing'! |
571 |
||
572 |
isTextObject |
|
573 |
"return true, if the dropObject represents some text" |
|
574 |
||
575 |
^ true |
|
576 |
||
577 |
"Modified: 19.4.1997 / 12:52:08 / cg" |
|
578 |
! ! |
|
579 |
||
395 | 580 |
!DropObject class methodsFor:'documentation'! |
581 |
||
582 |
version |
|
2749 | 583 |
^ '$Header: /cvs/stx/stx/libview2/DropObject.st,v 1.20 2009-09-22 08:22:40 cg Exp $' |
395 | 584 |
! ! |