--- a/AbstractFileApplicationNoteBookComponent.st Thu Mar 01 21:48:51 2007 +0100
+++ b/AbstractFileApplicationNoteBookComponent.st Thu Mar 01 21:48:54 2007 +0100
@@ -44,8 +44,18 @@
!AbstractFileApplicationNoteBookComponent class methodsFor:'defaults'!
tabStringFor:aApplicationType
+ "the formatString shown in a tab (language translated)"
^ nil
+
+ "Modified: / 01-03-2007 / 21:43:10 / cg"
+!
+
+tabStringFor:aApplicationType forContents:shownContents
+
+ ^ nil
+
+ "Created: / 01-03-2007 / 21:35:39 / cg"
! !
!AbstractFileApplicationNoteBookComponent class methodsFor:'queries'!
@@ -169,26 +179,25 @@
!
getTabString
+ "get the tab string from the application"
-" get the tab string from the application list on the class side "
+ ^ String streamContents:[:stream |
+ |formatString valueString|
- | stream string firstString endString|
+ valueString := self getTabValueString.
+ valueString isNil ifTrue:[
+ valueString := resources string:'<unnamed>'
+ ].
- stream := WriteStream on:''.
- firstString := self class tabStringFor:type.
- firstString isNil ifTrue:[
- "/ default take the class name
- firstString := self className.
+ formatString := self class tabStringFor:type.
+ formatString isNil ifTrue:[
+ "/ default: take the class name
+ formatString := self className.
+ ].
+ stream nextPutAll:(resources string:formatString with:valueString).
].
- stream nextPutAll:firstString.
- endString := self getTabStringEnd.
- endString notNil ifTrue:[
- stream space.
- stream nextPutAll:endString.
- ].
- string := stream contents.
- stream close.
- ^ string.
+
+ "Modified: / 01-03-2007 / 21:45:02 / cg"
!
getTabStringEnd
@@ -217,6 +226,36 @@
^ nil
!
+getTabValueString
+ "the item shown in a tab (not language translated)"
+
+ |stream|
+
+ self item isNil ifTrue:[^ nil].
+
+ ^ String streamContents:[:stream |
+ |fn baseName|
+
+ fn := self fileName.
+ baseName := fn baseName.
+ self type = #directoryDescription ifTrue:[
+ stream nextPutAll:(fn directory baseName).
+ stream space.
+ stream nextPut:$[.
+ stream nextPutAll:baseName.
+ stream nextPut:$].
+ ] ifFalse:[
+ stream nextPutAll:baseName.
+ stream space.
+ self sameFileIndex notNil ifTrue:[
+ stream nextPutAll:self sameFileIndex asString.
+ ].
+ ].
+ ].
+
+ "Created: / 01-03-2007 / 21:40:03 / cg"
+!
+
isEmbeddedApplication
^ self masterApplication notNil
@@ -275,5 +314,5 @@
!AbstractFileApplicationNoteBookComponent class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/AbstractFileApplicationNoteBookComponent.st,v 1.18 2006-10-24 10:33:24 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/AbstractFileApplicationNoteBookComponent.st,v 1.19 2007-03-01 20:48:54 cg Exp $'
! !