author | Claus Gittinger <cg@exept.de> |
Mon, 30 Jun 2003 15:24:18 +0200 | |
changeset 5010 | 27aa6fa93dcd |
parent 4529 | 134c48ecdef5 |
child 5120 | e4c15c9d82ba |
permissions | -rw-r--r-- |
3892 | 1 |
"{ Package: 'stx:libtool' }" |
2 |
||
3 |
ApplicationModel subclass:#AbstractFileApplicationNoteBookComponent |
|
4 |
instanceVariableNames:'sameFileIndex item type notifyChannel' |
|
5 |
classVariableNames:'' |
|
6 |
poolDictionaries:'' |
|
7 |
category:'Interface-Tools-File' |
|
8 |
! |
|
9 |
||
10 |
||
11 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'defaults'! |
|
12 |
||
13 |
tabStringFor:aApplicationType |
|
14 |
||
15 |
^ nil |
|
16 |
! ! |
|
17 |
||
18 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'queries'! |
|
19 |
||
5010 | 20 |
canOpenItem:anItem |
3892 | 21 |
|
22 |
" |
|
23 |
example: |
|
5010 | 24 |
^ (anItem suffix == 'cc') |
3892 | 25 |
" |
26 |
^ false |
|
27 |
! |
|
28 |
||
29 |
wantNewApplicationAnyway |
|
30 |
||
31 |
^ true |
|
32 |
! ! |
|
33 |
||
34 |
!AbstractFileApplicationNoteBookComponent methodsFor:'accessing'! |
|
35 |
||
4529 | 36 |
notify:msg |
37 |
self notifyChannel value:msg |
|
38 |
! |
|
39 |
||
3892 | 40 |
notifyChannel |
41 |
notifyChannel isNil ifTrue:[ |
|
42 |
self masterApplication notNil ifTrue:[ |
|
43 |
notifyChannel := masterApplication notifyChannel. |
|
44 |
] ifFalse:[ |
|
45 |
notifyChannel := ValueHolder with:''. |
|
46 |
]. |
|
47 |
]. |
|
48 |
^ notifyChannel |
|
49 |
! |
|
50 |
||
51 |
sameFileIndex |
|
52 |
||
53 |
^ sameFileIndex |
|
54 |
! |
|
55 |
||
56 |
sameFileIndex:something |
|
57 |
||
58 |
sameFileIndex := something. |
|
59 |
! ! |
|
60 |
||
61 |
!AbstractFileApplicationNoteBookComponent methodsFor:'actions'! |
|
62 |
||
5010 | 63 |
changeItem:anItem |
3892 | 64 |
|
5010 | 65 |
^ self item:anItem. |
3892 | 66 |
! |
67 |
||
68 |
doClose |
|
69 |
|master| |
|
70 |
||
71 |
"/ tell the NoteBookApplication to close me |
|
72 |
(master := self masterApplication) notNil ifTrue:[ |
|
73 |
master closeSubCanvas:self. |
|
3933
2e083e6e224f
must send #release manually (to release processes)
Claus Gittinger <cg@exept.de>
parents:
3892
diff
changeset
|
74 |
self release. |
3892 | 75 |
] ifFalse:[ |
76 |
self closeRequest. |
|
77 |
]. |
|
3954 | 78 |
^ true |
3892 | 79 |
! ! |
80 |
||
81 |
!AbstractFileApplicationNoteBookComponent methodsFor:'queries'! |
|
82 |
||
83 |
fileName |
|
84 |
||
85 |
item notNil ifTrue:[ |
|
86 |
^ item fileName. |
|
87 |
]. |
|
88 |
^ nil |
|
89 |
! |
|
90 |
||
91 |
getDirWithoutFileName:aFileName |
|
92 |
||
93 |
| dir | |
|
94 |
aFileName isNil ifTrue:[ |
|
95 |
^ aFileName. |
|
96 |
]. |
|
97 |
dir := aFileName asFilename. |
|
98 |
dir isDirectory ifFalse:[ |
|
99 |
dir := dir directory. |
|
100 |
]. |
|
101 |
^ dir. |
|
102 |
! |
|
103 |
||
104 |
getTabString |
|
105 |
||
106 |
" get the tab string from the application list on the class side " |
|
107 |
||
108 |
| stream string firstString endString| |
|
109 |
||
110 |
stream := WriteStream on:''. |
|
111 |
firstString := self class tabStringFor:type. |
|
112 |
firstString isNil ifTrue:[ |
|
113 |
"/ default take the class name |
|
114 |
firstString := self className. |
|
115 |
]. |
|
116 |
stream nextPutAll:firstString. |
|
117 |
endString := self getTabStringEnd. |
|
118 |
endString notNil ifTrue:[ |
|
119 |
stream space. |
|
120 |
stream nextPutAll:endString. |
|
121 |
]. |
|
122 |
string := stream contents. |
|
123 |
stream close. |
|
124 |
^ string. |
|
125 |
! |
|
126 |
||
127 |
getTabStringEnd |
|
128 |
||
129 |
" get the tab string from the application list on the class side " |
|
130 |
||
131 |
| stream string| |
|
132 |
||
133 |
self item notNil ifTrue:[ |
|
134 |
stream := WriteStream on:''. |
|
135 |
stream nextPutAll:self fileName baseName. |
|
136 |
stream space. |
|
137 |
self sameFileIndex notNil ifTrue:[ |
|
138 |
stream nextPutAll:self sameFileIndex asString. |
|
139 |
]. |
|
140 |
string := stream contents. |
|
141 |
stream close. |
|
142 |
^ string. |
|
143 |
]. |
|
144 |
^ nil |
|
145 |
! |
|
146 |
||
147 |
isEmbeddedApplication |
|
148 |
||
149 |
^ self masterApplication notNil |
|
150 |
! |
|
151 |
||
152 |
isModified |
|
153 |
||
154 |
^ false |
|
155 |
! |
|
156 |
||
4147 | 157 |
isTextEditor |
158 |
||
159 |
^ false |
|
160 |
! |
|
161 |
||
3892 | 162 |
item |
163 |
||
164 |
^ item |
|
165 |
! |
|
166 |
||
5010 | 167 |
item:anItem |
3892 | 168 |
|
5010 | 169 |
item := anItem. |
3892 | 170 |
^ true |
171 |
! |
|
172 |
||
173 |
presentation |
|
174 |
||
175 |
^ nil |
|
176 |
! |
|
177 |
||
178 |
type |
|
179 |
||
180 |
^ type |
|
181 |
! |
|
182 |
||
183 |
type:aType |
|
184 |
||
185 |
type := aType |
|
186 |
! |
|
187 |
||
188 |
wantChangeAnyWay |
|
189 |
||
190 |
^ (self type == #directoryDescription) |
|
191 |
! ! |
|
192 |
||
193 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'! |
|
194 |
||
195 |
version |
|
5010 | 196 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileApplicationNoteBookComponent.st,v 1.7 2003-06-30 13:24:10 cg Exp $' |
3892 | 197 |
! ! |