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