2564
|
1 |
"
|
|
2 |
COPYRIGHT (c) 2002 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 |
"
|
|
12 |
|
2195
|
13 |
"{ Package: 'stx:libwidg2' }"
|
|
14 |
|
|
15 |
ListEntry subclass:#ModelListEntry
|
|
16 |
instanceVariableNames:'string model'
|
|
17 |
classVariableNames:''
|
|
18 |
poolDictionaries:''
|
|
19 |
category:'Views-Support'
|
|
20 |
!
|
|
21 |
|
|
22 |
!ModelListEntry class methodsFor:'documentation'!
|
|
23 |
|
2564
|
24 |
copyright
|
|
25 |
"
|
|
26 |
COPYRIGHT (c) 2002 by eXept Software AG
|
|
27 |
All Rights Reserved
|
|
28 |
|
|
29 |
This software is furnished under a license and may be used
|
|
30 |
only in accordance with the terms of that license and with the
|
|
31 |
inclusion of the above copyright notice. This software may not
|
|
32 |
be provided or otherwise made available to, or used by, any
|
|
33 |
other person. No title to or ownership of the software is
|
|
34 |
hereby transferred.
|
|
35 |
"
|
|
36 |
!
|
|
37 |
|
2195
|
38 |
documentation
|
|
39 |
"
|
|
40 |
Use this class, if you provide some SelectionInListView, ComboBox, etc. with
|
|
41 |
both a display string, and you want to store some model specific information, too.
|
|
42 |
|
|
43 |
You can store a class, a selector to perform, a factory object or anything else
|
|
44 |
in model.
|
|
45 |
|
|
46 |
[author:]
|
|
47 |
Stefan Vogel (stefan@zwerg)
|
|
48 |
|
|
49 |
[instance variables:]
|
|
50 |
string String string to display
|
|
51 |
model Object anything you want to store
|
|
52 |
|
|
53 |
[class variables:]
|
|
54 |
|
|
55 |
[see also:]
|
|
56 |
|
|
57 |
"
|
|
58 |
! !
|
|
59 |
|
|
60 |
!ModelListEntry class methodsFor:'instance creation'!
|
|
61 |
|
|
62 |
string:stringArg model:modelArg
|
|
63 |
|
|
64 |
^ self new string:stringArg model:modelArg
|
|
65 |
! !
|
|
66 |
|
|
67 |
!ModelListEntry methodsFor:'accessing'!
|
|
68 |
|
|
69 |
model
|
|
70 |
^ model
|
|
71 |
!
|
|
72 |
|
|
73 |
model:something
|
|
74 |
model := something.
|
|
75 |
!
|
|
76 |
|
2656
|
77 |
string
|
|
78 |
^ string
|
|
79 |
!
|
|
80 |
|
2195
|
81 |
string:something
|
|
82 |
string := something.
|
|
83 |
!
|
|
84 |
|
|
85 |
string:stringArg model:modelArg
|
|
86 |
string := stringArg.
|
|
87 |
model := modelArg.
|
|
88 |
! !
|
|
89 |
|
|
90 |
!ModelListEntry methodsFor:'required protocol'!
|
|
91 |
|
|
92 |
asString
|
|
93 |
|
|
94 |
^ string
|
|
95 |
!
|
|
96 |
|
|
97 |
displayOn:arg1 x:arg2 y:arg3 opaque:arg4
|
|
98 |
|
|
99 |
^ string displayOn:arg1 x:arg2 y:arg3 opaque:arg4
|
|
100 |
!
|
|
101 |
|
|
102 |
sameStringAndEmphasisAs:aStringOrText
|
|
103 |
|
|
104 |
aStringOrText class == self class ifTrue:[
|
|
105 |
^ string sameStringAndEmphasisAs:aStringOrText string
|
|
106 |
].
|
|
107 |
^ string sameStringAndEmphasisAs:aStringOrText
|
|
108 |
!
|
|
109 |
|
|
110 |
widthOn:arg
|
|
111 |
|
|
112 |
^ string widthOn:arg
|
|
113 |
! !
|
|
114 |
|
2570
|
115 |
!ModelListEntry methodsFor:'string protocol'!
|
|
116 |
|
|
117 |
expandPlaceholdersWith:argArrayOrDictionary
|
|
118 |
^ self copy string:(string expandPlaceholdersWith:argArrayOrDictionary)
|
|
119 |
! !
|
|
120 |
|
2195
|
121 |
!ModelListEntry class methodsFor:'documentation'!
|
|
122 |
|
|
123 |
version
|
2656
|
124 |
^ '$Header: /cvs/stx/stx/libwidg2/ModelListEntry.st,v 1.4 2004-02-25 16:09:56 cg Exp $'
|
2195
|
125 |
! !
|