author | sr |
Tue, 03 Jul 2007 15:18:40 +0200 | |
changeset 2334 | ec0c03d247f5 |
parent 2253 | bed5e9c3cc21 |
child 2589 | ddcdc2e7d3f3 |
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." |
|
115 |
||
116 |
someThing isColor ifTrue:[^ DropObject::Color]. |
|
117 |
someThing isImageOrForm ifTrue:[^ DropObject::Image]. |
|
118 |
(someThing isKindOf:Filename) ifTrue:[^ DropObject::File]. |
|
119 |
someThing isString ifTrue:[^ DropObject::Text]. |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
120 |
someThing isBehavior ifTrue:[^ DropObject::Class]. |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
121 |
someThing isMethod ifTrue:[^ DropObject::Method]. |
1112 | 122 |
^ self |
123 |
! |
|
124 |
||
395 | 125 |
new:someThing |
547 | 126 |
"create an instance on something |
395 | 127 |
" |
128 |
|cls| |
|
129 |
||
1112 | 130 |
cls := self dropObjectClassFor:someThing. |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
131 |
^ self newInstanceOf:cls for:someThing |
547 | 132 |
|
133 |
"Modified: 19.4.1997 / 17:19:55 / cg" |
|
395 | 134 |
! |
135 |
||
1482 | 136 |
newClass:aClass |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
137 |
"create an instance for a class (dragging a class from a browser)" |
1482 | 138 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
139 |
^ self newInstanceOf:DropObject::Class for:aClass |
1482 | 140 |
! |
141 |
||
395 | 142 |
newColor:aColor |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
143 |
"create an instance for a color (dragging a color from a bitmap editor)" |
547 | 144 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
145 |
^ self newInstanceOf:DropObject::Color for:aColor |
547 | 146 |
|
147 |
"Modified: 19.4.1997 / 17:20:17 / cg" |
|
395 | 148 |
! |
149 |
||
150 |
newFile:aFilename |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
151 |
"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
|
152 |
|
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
153 |
^ self newInstanceOf:DropObject::File for:aFilename |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
154 |
! |
547 | 155 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
156 |
newFileInArchive:aFilename |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
157 |
"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
|
158 |
(dragging a file from an archive shown in a fileBrowser)" |
547 | 159 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
160 |
^ self newInstanceOf:DropObject::FileInArchive for:aFilename |
395 | 161 |
! |
162 |
||
163 |
newImage:anImageOrForm |
|
547 | 164 |
"create an instance for an image" |
165 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
166 |
^ self newInstanceOf:DropObject::Image for:anImageOrForm |
547 | 167 |
|
168 |
"Modified: 19.4.1997 / 17:20:37 / cg" |
|
395 | 169 |
! |
170 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
171 |
newInstanceOf:aClass for:someThing |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
172 |
"create an instance on something |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
173 |
" |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
174 |
^ aClass new theObject:someThing |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
175 |
|
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
176 |
"Modified: 19.4.1997 / 17:19:55 / cg" |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
177 |
! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
178 |
|
1482 | 179 |
newMethod:aMethod |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
180 |
"create an instance for a method (dragging a method in a browser)" |
1482 | 181 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
182 |
^ self newInstanceOf:DropObject::Method for:aMethod |
1482 | 183 |
! |
184 |
||
395 | 185 |
newText:aTextOrString |
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
186 |
"create an instance for some text (dragging some text from an editor)" |
547 | 187 |
|
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
188 |
^ self newInstanceOf:DropObject::Text for:aTextOrString |
547 | 189 |
|
190 |
"Modified: 19.4.1997 / 17:20:46 / cg" |
|
395 | 191 |
! ! |
192 |
||
403 | 193 |
!DropObject class methodsFor:'defaults'! |
194 |
||
195 |
displayObject |
|
546 | 196 |
"return some object which is shown while dragging; |
197 |
here an image based upon my displayObjectName is returned. |
|
198 |
Either this method or #displayObjectName is usually redefined |
|
199 |
in subclasses" |
|
403 | 200 |
|
201 |
DisplayObject notNil ifTrue:[ |
|
202 |
^ DisplayObject |
|
203 |
]. |
|
1292 | 204 |
DisplayObject := Smalltalk imageFromFileNamed:(self displayObjectName) forClass:self. |
403 | 205 |
^ DisplayObject |
546 | 206 |
|
207 |
"Modified: 19.4.1997 / 13:04:05 / cg" |
|
208 |
! |
|
209 |
||
210 |
displayObject:aDisplayObject |
|
211 |
"set the object which is shown while dragging; |
|
212 |
this object must understand #displayOn:x:y: (i.e. the displayObject |
|
213 |
protocol). The object is kept per class for ALL future drag operations. |
|
214 |
Useful to change the default images in subclasses." |
|
215 |
||
216 |
DisplayObject := aDisplayObject |
|
217 |
||
218 |
"Modified: 19.4.1997 / 15:42:10 / cg" |
|
403 | 219 |
! |
220 |
||
221 |
displayObjectName |
|
546 | 222 |
"return the name of a bitmap image file, which is used |
223 |
during a drag. |
|
224 |
Here, a dummy file is returned." |
|
225 |
||
403 | 226 |
^ 'bitmaps/xpmBitmaps/plain_pixmaps/balloon3.xpm' |
227 |
||
546 | 228 |
"Modified: 19.4.1997 / 13:54:13 / cg" |
403 | 229 |
! ! |
230 |
||
395 | 231 |
!DropObject methodsFor:'accessing'! |
232 |
||
860 | 233 |
displayObject |
234 |
"return my graphical representation - here a default is returned" |
|
235 |
||
236 |
^ displayObject ? (self class displayObject) |
|
237 |
||
238 |
||
239 |
! |
|
240 |
||
241 |
displayObject:anObject |
|
242 |
"set my graphical representation" |
|
243 |
||
244 |
displayObject := anObject |
|
245 |
||
246 |
! |
|
247 |
||
395 | 248 |
theObject |
546 | 249 |
"return the real object represented by the receiver" |
395 | 250 |
|
546 | 251 |
^ theObject |
252 |
||
253 |
"Modified: 19.4.1997 / 12:53:01 / cg" |
|
254 |
! |
|
395 | 255 |
|
256 |
theObject:something |
|
546 | 257 |
"set the real object represented by the receiver" |
395 | 258 |
|
546 | 259 |
theObject := something. |
260 |
||
261 |
"Modified: 19.4.1997 / 12:53:10 / cg" |
|
262 |
! ! |
|
395 | 263 |
|
264 |
!DropObject methodsFor:'testing'! |
|
265 |
||
1482 | 266 |
isClassObject |
267 |
"return true, if the dropObject represents some class" |
|
268 |
||
269 |
^ false |
|
270 |
! |
|
271 |
||
395 | 272 |
isColorObject |
546 | 273 |
"return true, if the dropObject represents a color" |
274 |
||
395 | 275 |
^ false |
546 | 276 |
|
277 |
"Modified: 19.4.1997 / 12:52:36 / cg" |
|
395 | 278 |
! |
279 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
280 |
isFileInArchive |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
281 |
^ false |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
282 |
! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
283 |
|
395 | 284 |
isFileObject |
546 | 285 |
"return true, if the dropObject represents some file or directory" |
286 |
||
395 | 287 |
^ false |
546 | 288 |
|
289 |
"Modified: 19.4.1997 / 12:52:29 / cg" |
|
395 | 290 |
! |
291 |
||
292 |
isImageObject |
|
546 | 293 |
"return true, if the dropObject represents some image" |
294 |
||
395 | 295 |
^ false |
546 | 296 |
|
297 |
"Modified: 19.4.1997 / 12:52:22 / cg" |
|
395 | 298 |
! |
299 |
||
1482 | 300 |
isMethodObject |
301 |
"return true, if the dropObject represents some method" |
|
302 |
||
303 |
^ false |
|
304 |
! |
|
305 |
||
395 | 306 |
isTextObject |
546 | 307 |
"return true, if the dropObject represents some text" |
308 |
||
395 | 309 |
^ false |
546 | 310 |
|
311 |
"Modified: 19.4.1997 / 12:52:17 / cg" |
|
312 |
! ! |
|
313 |
||
1482 | 314 |
!DropObject::Class methodsFor:'testing'! |
315 |
||
316 |
isClassObject |
|
317 |
"return true, if the dropObject represents a class" |
|
318 |
||
319 |
^ true |
|
320 |
! ! |
|
321 |
||
322 |
!DropObject::Color class methodsFor:'defaults'! |
|
323 |
||
324 |
displayObjectName |
|
325 |
"return the name of a bitmap image file, which is used |
|
326 |
during a drag." |
|
327 |
||
328 |
^ 'bitmaps/xpmBitmaps/misc_tools/color_wheel.xpm' |
|
329 |
||
330 |
"Modified: 19.4.1997 / 15:38:12 / cg" |
|
331 |
! ! |
|
332 |
||
333 |
!DropObject::Color methodsFor:'testing'! |
|
334 |
||
335 |
isColorObject |
|
336 |
"return true, if the dropObject represents a color" |
|
337 |
||
338 |
^ true |
|
339 |
||
340 |
"Modified: 19.4.1997 / 12:51:57 / cg" |
|
341 |
! ! |
|
342 |
||
403 | 343 |
!DropObject::File class methodsFor:'defaults'! |
344 |
||
345 |
displayObjectName |
|
546 | 346 |
"return the name of a bitmap image file, which is used |
347 |
during a drag." |
|
403 | 348 |
|
546 | 349 |
^ 'bitmaps/xpmBitmaps/document_images/xfm_file.xpm' |
403 | 350 |
|
546 | 351 |
"Modified: 19.4.1997 / 15:38:07 / cg" |
403 | 352 |
! ! |
353 |
||
354 |
!DropObject::File methodsFor:'accessing'! |
|
355 |
||
356 |
theObject:aPathname |
|
546 | 357 |
|f path| |
403 | 358 |
|
546 | 359 |
f := aPathname asFilename. |
360 |
path := f pathName. |
|
361 |
info := f info. |
|
403 | 362 |
|
546 | 363 |
super theObject:f |
364 |
||
365 |
"Modified: 19.4.1997 / 12:49:17 / cg" |
|
403 | 366 |
! ! |
367 |
||
368 |
!DropObject::File methodsFor:'queries'! |
|
369 |
||
2253 | 370 |
asFilename |
371 |
^ theObject asString asFilename |
|
372 |
||
373 |
"Created: / 13-10-2006 / 17:22:24 / cg" |
|
374 |
! |
|
375 |
||
403 | 376 |
exists |
546 | 377 |
"returns true if the file or directory exists |
403 | 378 |
" |
379 |
^ info notNil |
|
546 | 380 |
|
381 |
"Modified: 19.4.1997 / 12:49:30 / cg" |
|
403 | 382 |
! |
383 |
||
384 |
isDirectory |
|
385 |
"checks whether file is a directory |
|
386 |
" |
|
387 |
^ (info notNil and:[info type == #directory]) |
|
388 |
! |
|
389 |
||
390 |
isHtmlFile |
|
546 | 391 |
"checks whether file is an html file |
403 | 392 |
" |
393 |
|suffixes pathName| |
|
394 |
||
395 |
isHtmlFile isNil ifTrue:[ |
|
396 |
(info isNil or:[self isDirectory]) ifTrue:[ |
|
397 |
isHtmlFile := false |
|
398 |
] ifFalse:[ |
|
399 |
pathName := theObject asString. |
|
400 |
suffixes := #( '.html' '.htm' '.HTML' '.HTM' ). |
|
401 |
isHtmlFile := (suffixes findFirst:[:el|pathName endsWith:el]) ~~ 0 |
|
402 |
] |
|
403 |
]. |
|
404 |
^ isHtmlFile |
|
546 | 405 |
|
406 |
"Modified: 19.4.1997 / 12:49:37 / cg" |
|
403 | 407 |
! |
408 |
||
409 |
isImageFile |
|
546 | 410 |
"returns true if file is an image file |
403 | 411 |
" |
546 | 412 |
|pathName| |
403 | 413 |
|
414 |
isImageFile isNil ifTrue:[ |
|
415 |
(info isNil or:[self isDirectory]) ifTrue:[ |
|
416 |
isImageFile := false |
|
417 |
] ifFalse:[ |
|
418 |
pathName := theObject asString. |
|
546 | 419 |
isImageFile := Image isImageFileSuffix:(pathName asFilename suffix). |
403 | 420 |
] |
421 |
]. |
|
422 |
^ isImageFile |
|
423 |
||
546 | 424 |
"Modified: 19.4.1997 / 12:50:58 / cg" |
403 | 425 |
! |
426 |
||
427 |
isPrintable |
|
1952
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
428 |
"return false if file contains nonprintable characters" |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
429 |
|
403 | 430 |
|stream buff size| |
431 |
||
432 |
isPrintable isNil ifTrue:[ |
|
433 |
isPrintable := false. |
|
1952
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
434 |
(info isNil or:[ self isDirectory ]) ifFalse:[ |
1709
fc33be8aaa9c
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
1623
diff
changeset
|
435 |
stream := theObject readStreamOrNil. |
fc33be8aaa9c
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
1623
diff
changeset
|
436 |
stream notNil ifTrue:[ |
403 | 437 |
buff := String new:300. |
438 |
size := stream nextBytes:300 into:buff. |
|
439 |
stream close. |
|
1952
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
440 |
1 to:size do:[:i | |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
441 |
(buff at:i) isPrintable ifFalse:[ |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
442 |
^ false |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
443 |
] |
5009754ae556
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1784
diff
changeset
|
444 |
]. |
403 | 445 |
]. |
446 |
isPrintable := true |
|
447 |
] |
|
448 |
]. |
|
449 |
^ isPrintable |
|
450 |
! ! |
|
451 |
||
452 |
!DropObject::File methodsFor:'testing'! |
|
453 |
||
454 |
isFileObject |
|
546 | 455 |
"return true, if the dropObject represents a file- or directory" |
396 | 456 |
|
457 |
^ true |
|
458 |
||
546 | 459 |
"Modified: 19.4.1997 / 12:51:49 / cg" |
395 | 460 |
! ! |
461 |
||
1784
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
462 |
!DropObject::FileInArchive methodsFor:'testing'! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
463 |
|
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
464 |
isFileInArchive |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
465 |
^ true |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
466 |
! ! |
67f412dd5926
refactored inst-creation code;
Claus Gittinger <cg@exept.de>
parents:
1709
diff
changeset
|
467 |
|
1292 | 468 |
!DropObject::Image class methodsFor:'defaults'! |
469 |
||
470 |
displayObjectName |
|
471 |
"return the name of a bitmap image file, which is used |
|
472 |
during a drag." |
|
473 |
||
474 |
^ 'bitmaps/xpmBitmaps/misc_tools/picture.xpm' |
|
475 |
||
476 |
"Modified: 19.4.1997 / 15:38:02 / cg" |
|
477 |
! ! |
|
478 |
||
479 |
!DropObject::Image methodsFor:'testing'! |
|
480 |
||
481 |
isImageObject |
|
482 |
"return true, if the dropObject represents an image" |
|
483 |
||
484 |
^ true |
|
485 |
||
486 |
"Modified: 19.4.1997 / 12:51:28 / cg" |
|
487 |
! ! |
|
488 |
||
1482 | 489 |
!DropObject::Method methodsFor:'testing'! |
490 |
||
491 |
isMethodObject |
|
492 |
"return true, if the dropObject represents a method" |
|
493 |
||
494 |
^ true |
|
495 |
! ! |
|
496 |
||
497 |
!DropObject::Text class methodsFor:'defaults'! |
|
498 |
||
499 |
displayObjectName |
|
500 |
^ 'bitmaps/xpmBitmaps/document_images/yellow_file_text_grab.xpm' |
|
501 |
||
502 |
"Modified: 19.4.1997 / 15:40:33 / cg" |
|
503 |
! ! |
|
504 |
||
505 |
!DropObject::Text methodsFor:'testing'! |
|
506 |
||
507 |
isTextObject |
|
508 |
"return true, if the dropObject represents some text" |
|
509 |
||
510 |
^ true |
|
511 |
||
512 |
"Modified: 19.4.1997 / 12:52:08 / cg" |
|
513 |
! ! |
|
514 |
||
395 | 515 |
!DropObject class methodsFor:'documentation'! |
516 |
||
517 |
version |
|
2253 | 518 |
^ '$Header: /cvs/stx/stx/libview2/DropObject.st,v 1.16 2006-10-13 15:45:04 cg Exp $' |
395 | 519 |
! ! |