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