'From Cuis 1.0 of 16 July 2009 [latest update: #228] on 24 July 2009 at 4:42:49 pm'!

!Browser methodsFor: 'class functions' stamp: 'jmv 7/24/2009 16:35'!
classListMenu: aMenu shifted: shifted
	"Set up the menu to apply to the receiver's class list, honoring the #shifted boolean"

	shifted
		ifTrue:
			[^ self shiftedClassListMenu: aMenu].
	aMenu addList: #(
		-
		('browse full (b)'			browseMethodFull)
		('browse hierarchy (h)'		spawnHierarchy)
		('browse protocol (p)'		browseFullProtocol)
		-
		('fileOut'					fileOutClass)
		-
		('show hierarchy'			hierarchy)
		('show definition'			editClass)
		('show comment'			editComment)
		-
		('inst var refs...'			browseInstVarRefs)
		('inst var defs...'			browseInstVarDefs)
		-
		('class var refs...'			browseClassVarRefs)
		('class vars'					browseClassVariables)
		('class refs (N)'				browseClassRefs)
		-
		('rename class ...'			renameClass)
		('copy class...'				copyClass)
		('remove class (x)'			removeClass)
		-
		('find method...'				findMethod)
		-
		('more...'					offerShiftedClassListMenu)).
	^ aMenu! !


!PositionableStream methodsFor: 'fileIn/Out' stamp: 'jmv 7/24/2009 16:40'!
copyPreamble: preamble from: aStream
	"Look for a changeStamp for this method by peeking backward.
	Write a method preamble, with that stamp if found."
	| terminator methodPos oldPreamble stamp oldClassName |
	terminator _ $!!.

	"Look back to find stamp in old preamble, such as...
	Polygon methodsFor: 'private' stamp: 'di 6/25/97 21:42' prior: 34957598!! "
	methodPos _ aStream position.
	aStream backChunk.				"to beginning of method"
	oldPreamble _ aStream backChunk.		"to get preamble"
	aStream position: methodPos.
	oldClassName _ oldPreamble substrings first asSymbol.
	(Smalltalk includesKey: oldClassName) ifFalse: [
		oldPreamble _ 'Object', (oldPreamble copyFrom: oldClassName size+1 to: oldPreamble size) ].
	stamp _ (Compiler evaluate: oldPreamble) changeStamp ifNil: [''].
	"Write the new preamble, with old stamp if any."
	self cr; nextPut: terminator.
	self nextChunkPut: (String streamContents: [ :strm |
		strm nextPutAll: preamble.
		stamp size > 0 ifTrue: [
			strm nextPutAll: ' stamp: '; print: stamp]]).
	self cr! !

