"" | me | ctx _ thisContext. [ctx == nil or:[ctx receiver isKindOf: FileStream]] whileFalse:[ctx _ ctx sender]. ctx ifNotNil:[me _ ctx receiver]. me ifNotNil: [me converter: UTF8TextConverter new.]! !ArchiveViewer methodsFor: 'initialization' stamp: 'yo 7/27/2004 22:47'! createButtonBar | bar button narrowFont registeredFonts | registeredFonts _ OrderedCollection new. TextStyle knownTextStyles do: [:st | (TextStyle named: st) fonts do: [:f | registeredFonts addLast: f]]. narrowFont := registeredFonts detectMin: [:ea | ea widthOfString: 'Contents' from: 1 to: 8]. bar := AlignmentMorph newRow. bar color: self backgroundColor; rubberBandCells: false; vResizing: #shrinkWrap; cellInset: 6 @ 0. #(#('New\Archive' #canCreateNewArchive #createNewArchive 'Create a new, empty archive and discard this one') #('Load\Archive' #canOpenNewArchive #openNewArchive 'Open another archive and discard this one') #('Save\Archive As' #canSaveArchive #saveArchive 'Save this archive under a new name') #('Extract\All' #canExtractAll #extractAll 'Extract all this archive''s members into a directory') #('Add\File' #canAddMember #addMember 'Add a file to this archive') #('Add from\Clipboard' #canAddMember #addMemberFromClipboard 'Add the contents of the clipboard as a new file') #('Add\Directory' #canAddMember #addDirectory 'Add the entire contents of a directory, with all of its subdirectories') #('Extract\Member As' #canExtractMember #extractMember 'Extract the selected member to a file') #('Delete\Member' #canDeleteMember #deleteMember 'Remove the selected member from this archive') #('Rename\Member' #canRenameMember #renameMember 'Rename the selected member') #('View All\Contents' #canViewAllContents #changeViewAllContents 'Toggle the view of all the selected member''s contents')) do: [:arr | | buttonLabel | buttonLabel := (TextMorph new) string: arr first withCRs fontName: narrowFont familyName size: narrowFont pointSize wrap: false; hResizing: #shrinkWrap; lock; yourself. (button := PluggableButtonMorph on: self getState: arr second action: arr third) vResizing: #shrinkWrap; hResizing: #spaceFill; onColor: self buttonOnColor offColor: self buttonOffColor; label: buttonLabel; setBalloonText: arr fourth. bar addMorphBack: button. buttonLabel composeToBounds]. ^bar! ! !SMPackage methodsFor: 'accessing' stamp: 'yo 7/28/2004 17:14'! fullDescription "Return a full textual description of the package. Most of the description is taken from the last release." | s publishedRelease | s := TextStream on: (Text new: 400). self describe: name withBoldLabel: 'Name: ' on: s. summary isEmptyOrNil ifFalse: [self describe: summary withBoldLabel: 'Summary: ' on: s ]. author isEmptyOrNil ifFalse: [s withAttribute: TextEmphasis bold do: [s nextPutAll: 'Author:']; tab; tab. s withAttribute: (PluggableTextAttribute evalBlock: [self userInterface sendMailTo: (SMUtilities stripEmailFrom: author) regardingPackageRelease: self lastRelease]) do: [s nextPutAll: author]; cr]. self owner ifNotNil: [s withAttribute: TextEmphasis bold do: [s nextPutAll: 'Owner:']; tab; tab. s withAttribute: (PluggableTextAttribute evalBlock: [self userInterface sendMailTo: self owner email regardingPackageRelease: self lastRelease]) do: [s nextPutAll: self owner nameAndEmail]; cr]. self maintainers isEmpty ifFalse: [ s withAttribute: TextEmphasis bold do: [s nextPutAll: 'Co-maintainers:']; tab. self maintainers do: [:com | com = self maintainers first ifFalse: [s nextPutAll: ', ']. s withAttribute: (PluggableTextAttribute evalBlock: [self userInterface sendMailTo: com email regardingPackageRelease: self lastRelease]) do: [s nextPutAll: com nameAndEmail]]. s cr]. description isEmptyOrNil ifFalse: [s cr. s withAttribute: TextEmphasis bold do: [s nextPutAll: 'Description:']. s cr. s withAttribute: (TextIndent tabs: 1) do: [s next: (description findLast: [ :c | c isSeparator not ]) putAll: description]. s cr ]. self describeCategoriesOn: s indent: 1. s cr. publishedRelease _ self lastPublishedRelease. self describe: (self publishedVersion ifNil: ['']) withBoldLabel: 'Published version: ' on: s. self isPublished ifTrue: [ s withAttribute: TextEmphasis bold do: [ s nextPutAll: 'Created: ' ]; print: publishedRelease created; cr. self note isEmptyOrNil ifFalse: [s withAttribute: TextEmphasis bold do: [s nextPutAll: 'Release note:']. s cr. s withAttribute: (TextIndent tabs: 1) do: [s nextPutAll: publishedRelease note]. s cr ]]. url isEmptyOrNil ifFalse: [s cr; withAttribute: TextEmphasis bold do: [s nextPutAll: 'Homepage:']; tab; withAttribute: (TextURL new url: url) do: [s nextPutAll: url]; cr]. ^ s contents! !