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.
|
|
71 |
] ifFalse:[
|
|
72 |
self closeRequest.
|
|
73 |
].
|
|
74 |
! !
|
|
75 |
|
|
76 |
!AbstractFileApplicationNoteBookComponent methodsFor:'queries'!
|
|
77 |
|
|
78 |
fileName
|
|
79 |
|
|
80 |
item notNil ifTrue:[
|
|
81 |
^ item fileName.
|
|
82 |
].
|
|
83 |
^ nil
|
|
84 |
!
|
|
85 |
|
|
86 |
getDirWithoutFileName:aFileName
|
|
87 |
|
|
88 |
| dir |
|
|
89 |
aFileName isNil ifTrue:[
|
|
90 |
^ aFileName.
|
|
91 |
].
|
|
92 |
dir := aFileName asFilename.
|
|
93 |
dir isDirectory ifFalse:[
|
|
94 |
dir := dir directory.
|
|
95 |
].
|
|
96 |
^ dir.
|
|
97 |
!
|
|
98 |
|
|
99 |
getTabString
|
|
100 |
|
|
101 |
" get the tab string from the application list on the class side "
|
|
102 |
|
|
103 |
| stream string firstString endString|
|
|
104 |
|
|
105 |
stream := WriteStream on:''.
|
|
106 |
firstString := self class tabStringFor:type.
|
|
107 |
firstString isNil ifTrue:[
|
|
108 |
"/ default take the class name
|
|
109 |
firstString := self className.
|
|
110 |
].
|
|
111 |
stream nextPutAll:firstString.
|
|
112 |
endString := self getTabStringEnd.
|
|
113 |
endString notNil ifTrue:[
|
|
114 |
stream space.
|
|
115 |
stream nextPutAll:endString.
|
|
116 |
].
|
|
117 |
string := stream contents.
|
|
118 |
stream close.
|
|
119 |
^ string.
|
|
120 |
!
|
|
121 |
|
|
122 |
getTabStringEnd
|
|
123 |
|
|
124 |
" get the tab string from the application list on the class side "
|
|
125 |
|
|
126 |
| stream string|
|
|
127 |
|
|
128 |
self item notNil ifTrue:[
|
|
129 |
stream := WriteStream on:''.
|
|
130 |
stream nextPutAll:self fileName baseName.
|
|
131 |
stream space.
|
|
132 |
self sameFileIndex notNil ifTrue:[
|
|
133 |
stream nextPutAll:self sameFileIndex asString.
|
|
134 |
].
|
|
135 |
string := stream contents.
|
|
136 |
stream close.
|
|
137 |
^ string.
|
|
138 |
].
|
|
139 |
^ nil
|
|
140 |
!
|
|
141 |
|
|
142 |
isEmbeddedApplication
|
|
143 |
|
|
144 |
^ self masterApplication notNil
|
|
145 |
!
|
|
146 |
|
|
147 |
isModified
|
|
148 |
|
|
149 |
^ false
|
|
150 |
!
|
|
151 |
|
|
152 |
item
|
|
153 |
|
|
154 |
^ item
|
|
155 |
!
|
|
156 |
|
|
157 |
item:aItem
|
|
158 |
|
|
159 |
item := aItem.
|
|
160 |
^ true
|
|
161 |
!
|
|
162 |
|
|
163 |
presentation
|
|
164 |
|
|
165 |
^ nil
|
|
166 |
!
|
|
167 |
|
|
168 |
type
|
|
169 |
|
|
170 |
^ type
|
|
171 |
!
|
|
172 |
|
|
173 |
type:aType
|
|
174 |
|
|
175 |
type := aType
|
|
176 |
!
|
|
177 |
|
|
178 |
wantChangeAnyWay
|
|
179 |
|
|
180 |
^ (self type == #directoryDescription)
|
|
181 |
! !
|
|
182 |
|
|
183 |
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'!
|
|
184 |
|
|
185 |
version
|
|
186 |
^ '$Header: /cvs/stx/stx/libtool/AbstractFileApplicationNoteBookComponent.st,v 1.1 2002-09-25 08:00:15 penk Exp $'
|
|
187 |
! !
|