[Pkg] DeltaStreams: DeltaStreams-Browser-Igor.Stasenko.2.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Mon Sep 7 13:57:23 UTC 2009


Igor Stasenko uploaded a new version of DeltaStreams-Browser to project DeltaStreams:
http://www.squeaksource.com/DeltaStreams/DeltaStreams-Browser-Igor.Stasenko.2.mcz

==================== Summary ====================

Name: DeltaStreams-Browser-Igor.Stasenko.2
Author: Igor.Stasenko
Time: 7 September 2009, 4:46:43 am
UUID: 39e1b5dc-2a21-be46-8d40-b4dda2eb105f
Ancestors: DeltaStreams-Browser-Igor.Stasenko.1

- covered all class change types
- cleaned up the code a bit

=============== Diff against DeltaStreams-Browser-Igor.Stasenko.1 ===============

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyClassChange: (in category 'class changes') -----
- ----- Method: DSDeltaChangeViewer>>applyClassChange: (in category 'dschange dispatch') -----
  applyClassChange: aChange
  	"Default handler for any class change."
  	^ {
  		(self makeTextLabel: 'No view for ' , aChange class name)
  			frame: (0 at 0 corner: 1 @ 1); yourself.
  	}
  !

Item was added:
+ ----- Method: DSDeltaChangeViewer>>applyClassTypeChanged: (in category 'class changes') -----
+ applyClassTypeChanged: aChange
+ 	"Changed the type of a class"
+ 
+ 	^ self buildClassChangePane: aChange 
+ 		message: 'Class type changed' 
+ 		showMeta: false	
+ !

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyMethodAdded: (in category 'method changes') -----
- ----- Method: DSDeltaChangeViewer>>applyMethodAdded: (in category 'dschange dispatch') -----
  applyMethodAdded: aChange
  
  	^ {
  		(self makeTextLabel: 'Method added - ', aChange timeStampString)
  			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  
  		(self makeTextLabel: aChange stamp, ' - ', aChange protocol)
  			frame: (0 at 0.05 corner: 1 @ 0.1); yourself.
  
  		builder pluggableTextSpec new
  		model: aChange;
  		getText: #source;
  		frame: (0 at 0.1 corner: 1 @ 1);
  		yourself.
  
  	}!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyMethodRemoved: (in category 'method changes') -----
- ----- Method: DSDeltaChangeViewer>>applyMethodRemoved: (in category 'dschange dispatch') -----
  applyMethodRemoved: aChange
  
  	^ {
  		(self makeTextLabel: 'Method removed - ', aChange timeStampString)
  			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  
  		(self makeTextLabel: aChange stamp, ' - ', aChange protocol)
  			frame: (0 at 0.05 corner: 1 @ 0.1); yourself.
  		
  		builder pluggableTextSpec new
  		model: aChange;
  		getText: #source;
  		frame: (0 at 0.1 corner: 1 @ 1);
  		yourself.
  
  	}!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyClassRemoved: (in category 'class changes') -----
- ----- Method: DSDeltaChangeViewer>>applyClassRemoved: (in category 'dschange dispatch') -----
  applyClassRemoved: aChange
  
  	^ {
  		(self makeTextLabel: 'Class removed - ', aChange timeStampString)
  			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  			
  		builder pluggableCodePaneSpec new
  		model: (self getEditorFor: aChange) definition;
  		getText: #value;
  		frame: (0 at 0.05 corner: 1 @ 1);
  		yourself.
  	}!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyClassCreated: (in category 'class changes') -----
- ----- Method: DSDeltaChangeViewer>>applyClassCreated: (in category 'dschange dispatch') -----
  applyClassCreated: aChange
  
  	^ {
  		(self makeTextLabel: 'Class added - ', aChange timeStampString)
  			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  			
  		builder pluggableCodePaneSpec new
  		model: (self getEditorFor: aChange) definition;
  		getText: #value;
  		frame: (0 at 0.05 corner: 1 @ 1);
  		yourself.
  		}!

Item was changed:
  DSVisitor subclass: #DSDeltaChangeViewer
  	instanceVariableNames: 'before change builder'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'DeltaStreams-Browser'!
+ 
+ !DSDeltaChangeViewer commentStamp: 'Igor.Stasenko 9/7/2009 16:25' prior: 0!
+ This is a DSChange viewer which using a ToolBuilder to construct a UI for
+ displaying a single delta change.!

Item was added:
+ ----- Method: DSDeltaChangeViewer>>applyClassNameChanged: (in category 'class changes') -----
+ applyClassNameChanged: aChange
+ 	"Changed a class name."
+ 	^ self buildClassChangePane: aChange 
+ 		message: 'Class name changed' 
+ 		showMeta: false	
+ !

Item was changed:
  ----- Method: DSDeltaChangeViewer>>applyChange: (in category 'dschange dispatch') -----
  applyChange: change
+ 	"We should never get here"
+ 	self shouldNotImplement 
+ !
- 	^ 'boom...'!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>makeLabel (in category 'utils') -----
- ----- Method: DSDeltaChangeViewer>>makeLabel (in category 'as yet unclassified') -----
  makeLabel
  	^ builder pluggableInputFieldSpec new
  		model: self;
  		yourself!

Item was added:
+ ----- Method: DSDeltaChangeViewer>>applyClassVarsChanged: (in category 'class changes') -----
+ applyClassVarsChanged: aChange
+ 	"Changed class vars, we ignore ordering as it is irrelevant - 
+ 	they are actually kept in a Dictionary."
+ 
+ 	^ self buildClassChangePane: aChange 
+ 		message: 'Class variables changed' 
+ 		showMeta: false	
+ !

Item was added:
+ ----- Method: DSDeltaChangeViewer>>applySharedPoolVarsChanged: (in category 'class changes') -----
+ applySharedPoolVarsChanged: aChange
+ 	"Changed shared pool vars. Currently we just raise error if missing!!"
+ 
+ 	^ self buildClassChangePane: aChange 
+ 		message: 'Class shared pools changed' 
+ 		showMeta: false	
+ !

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyClassCategoryChanged: (in category 'class changes') -----
- ----- Method: DSDeltaChangeViewer>>applyClassCategoryChanged: (in category 'dschange dispatch') -----
  applyClassCategoryChanged: aChange
- 	^ {
- 		(self makeTextLabel: 'Class category changed - ', aChange timeStampString)
- 			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  
+ 	^ self buildClassChangePane: aChange 
+ 		message: 'Class category changed' 
+ 		showMeta: false	
+ !
- 		builder pluggableTextSpec new
- 		model:
- 			(self diffFrom: 
- 		 		((self getEditorFor: aChange) category: aChange oldCategory; yourself) definition
- 				to: (self getEditorFor: aChange) definition);
- 		getText: #value;
- 		frame: (0 at 0.05 corner: 1 @ 1);
- 		yourself.
- 
- 	}!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>buildViewOf:using: (in category 'utils') -----
- ----- Method: DSDeltaChangeViewer>>buildViewOf:using: (in category 'as yet unclassified') -----
  buildViewOf: aChange using: aBuilder
  
  	builder := aBuilder.
  	^ aChange applyUsing: self.!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>getEditorFor: (in category 'utils') -----
- ----- Method: DSDeltaChangeViewer>>getEditorFor: (in category 'as yet unclassified') -----
  getEditorFor: change
  
  	| superclassEditor classEditor |
  	superclassEditor := SystemEditor new ensureClassNamed: change superclassName.
  	
  	classEditor := superclassEditor 
  			subclass: change className
  			instanceVariableNames: change instVarNames asSpaceString
  			classVariableNames: change classVarNames asSpaceString
  			poolDictionaries: change poolDictionaryNames asSpaceString
  			category: change category.
  
  	classEditor typeOfClass: change type.
  	classEditor class instanceVariableNames: change classInstVarNames asSpaceString.
  	classEditor classComment: change comment stamp: change stamp.
  
  	^ classEditor!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyClassInstVarsChanged: (in category 'class changes') -----
- ----- Method: DSDeltaChangeViewer>>applyClassInstVarsChanged: (in category 'dschange dispatch') -----
  applyClassInstVarsChanged: aChange
+ 
+ 	^ self buildClassChangePane: aChange 
+ 		message: 'Class classinstance variables changed' 
+ 		showMeta: true
- 	^ {
- 		(self makeTextLabel: 'ClassInstance variables changed - ',  aChange timeStampString )
- 			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  
+ !
- 		(self makeTextLabel: (
- 			self diffFrom: ((self getEditorFor: aChange) classSide
- 					instanceVariableNames: aChange oldVars; yourself) definitionST80
- 				to: (self getEditorFor: aChange) classSide definitionST80))
- 			frame: (0 at 0.05 corner: 1 @ 1);
- 			yourself.
- 	}!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyMethodChange: (in category 'method changes') -----
- ----- Method: DSDeltaChangeViewer>>applyMethodChange: (in category 'dschange dispatch') -----
  applyMethodChange: aChange
  	^ {
  		(self makeTextLabel: 'No view for ' , aChange class name)
  			frame: (0 at 0 corner: 1 @ 1); yourself.
  	}
  !

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applySuperclassChanged: (in category 'class changes') -----
- ----- Method: DSDeltaChangeViewer>>applySuperclassChanged: (in category 'dschange dispatch') -----
  applySuperclassChanged: aChange
- 	"Default handler for any class change."
- 	| ed |
- 	ed := self getEditorFor: aChange.
- 	ed superclass: (ed system ensureClassNamed: aChange oldSuperclassName).
- 	
- 	^ {
- 		(self makeTextLabel: 'Class superclass changed - ', aChange timeStampString)
- 			frame: (0 at 0 corner: 1 @ 0.05); yourself.
- 
- 		(self makeTextLabel:
- 			(self diffFrom: ed definition to: (self getEditorFor: aChange) definition))			
- 		frame: (0 at 0.05 corner: 1 @ 1);
- 		yourself.
  
+ 	^ self buildClassChangePane: aChange 
+ 		message: 'Class superclass changed' 
+ 		showMeta: false	
+ !
- 	}!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyMethodSourceChanged: (in category 'method changes') -----
- ----- Method: DSDeltaChangeViewer>>applyMethodSourceChanged: (in category 'dschange dispatch') -----
  applyMethodSourceChanged: aChange
  	"Change the source of a method"
  
  	^ {
  		(self makeTextLabel: 'Method source changed - ', aChange timeStampString)
  			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  
  		(self makeTextLabel: 
  			(self diffFrom: aChange oldStamp, ' - ', aChange protocol to:
  			aChange newStamp, ' - ', aChange protocol))
  			frame: (0 at 0.05 corner: 1 @ 0.15); yourself.
  		
  		builder pluggableTextSpec new
  		model: (self diffFrom: aChange oldSource to: aChange source);
  		getText: #value;
  		frame: (0 at 0.15 corner: 1 @ 1);
  		yourself.
  		}
  		
  	!

Item was changed:
  Object subclass: #DSDeltaInspector
+ 	instanceVariableNames: 'subject changeSelected displayBefore rightPane'
- 	instanceVariableNames: 'subject changeSelected displayBefore chViewer rightPane'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'DeltaStreams-Browser'!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>diffFrom:to: (in category 'utils') -----
- ----- Method: DSDeltaChangeViewer>>diffFrom:to: (in category 'as yet unclassified') -----
  diffFrom: oldStr to: newStr
  	^ TextDiffBuilder 
  		buildDisplayPatchFrom: oldStr to: newStr!

Item was added:
+ ----- Method: DSDeltaChangeViewer>>classPaneFor:meta: (in category 'utils') -----
+ classPaneFor: aChange meta: aBool
+ 	"Build a text panel which should show a class definition, or metaclass definition"
+ 	
+ 	| ed oldEd text |
+ 	
+ 	ed := self getEditorFor: aChange.
+ 	oldEd := self getOldEditorFor: aChange.
+ 	
+ 	text := aBool ifTrue: [ self diffFrom: oldEd classSide definitionST80 to: ed classSide definitionST80]
+ 		ifFalse: [ self diffFrom: oldEd definitionST80 to: ed definitionST80].
+ 	^ self makeTextLabel: text
+ 	!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyMethodProtocolChanged: (in category 'method changes') -----
- ----- Method: DSDeltaChangeViewer>>applyMethodProtocolChanged: (in category 'dschange dispatch') -----
  applyMethodProtocolChanged: aChange
  
  	^ {
  		(self makeTextLabel: 
  			'Method protocol changed - ', aChange timeStampString)
  			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  
  		(self makeTextLabel: 
  			(self diffFrom: aChange stamp, ' - ', aChange oldProtocol to:
  			aChange stamp, ' - ', aChange newProtocol))
  			frame: (0 at 0.05 corner: 1 @ 0.15); yourself.
  	
  		
  		builder pluggableTextSpec new
  			model: aChange;
  			getText: #source;
  			frame: (0 at 0.15 corner: 1 @ 1);
  			yourself.
  	}!

Item was added:
+ ----- Method: DSDeltaChangeViewer>>buildClassChangePane:message:showMeta: (in category 'utils') -----
+ buildClassChangePane: aChange message: aMessage showMeta: aBool
+ 	"Common method for building the right pane to display a class change"
+ 
+ 	^ {
+ 		(self makeTextLabel: aMessage , ' - ', aChange timeStampString)
+ 			frame: (0 at 0 corner: 1 @ 0.05); yourself.
+ 
+ 		(self classPaneFor: aChange meta: aBool) 
+ 			frame: (0 at 0.05 corner: 1 @ 1);
+ 			yourself.
+ 	}!

Item was added:
+ ----- Method: DSDeltaChangeViewer>>getOldEditorFor: (in category 'utils') -----
+ getOldEditorFor: change
+ 
+ 	| superclassEditor classEditor |
+ 	superclassEditor := SystemEditor new ensureClassNamed: change oldSuperclassName.
+ 	
+ 	classEditor := superclassEditor 
+ 			subclass: change oldName
+ 			instanceVariableNames: change oldInstVarNames asSpaceString
+ 			classVariableNames: change oldClassVarNames asSpaceString
+ 			poolDictionaries: change oldPoolDictionaryNames asSpaceString
+ 			category: change oldCategory.
+ 
+ 	classEditor typeOfClass: change oldType.
+ 	classEditor class instanceVariableNames: change oldClassInstVarNames asSpaceString.
+ 	classEditor classComment: change oldComment stamp: change oldStamp.
+ 
+ 	^ classEditor!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>makeTextLabel: (in category 'utils') -----
- ----- Method: DSDeltaChangeViewer>>makeTextLabel: (in category 'as yet unclassified') -----
  makeTextLabel: aString
  
  	^ self makeLabel model: aString; getText: #value;
  		yourself.
  !

Item was added:
+ ----- Method: DSDeltaChangeViewer>>applyClassCommentChanged: (in category 'class changes') -----
+ applyClassCommentChanged: aChange
+ 	^ {
+ 		(self makeTextLabel: 'Class comment changed - ', aChange timeStampString)
+ 			frame: (0 at 0 corner: 1 @ 0.05); yourself.
+ 
+ 		(self makeTextLabel: 
+ 			(self diffFrom: aChange oldStamp to: aChange stamp))
+ 			frame: (0 at 0.05 corner: 1 @ 0.15); yourself.
+ 	
+ 		builder pluggableTextSpec new
+ 			model: (self diffFrom: aChange oldComment to: aChange comment);
+ 			getText: #value;
+ 			frame: (0 at 0.15 corner: 1 @ 1);
+ 			yourself.
+ 	}!

Item was changed:
+ ----- Method: DSDeltaChangeViewer>>applyInstVarsChanged: (in category 'class changes') -----
- ----- Method: DSDeltaChangeViewer>>applyInstVarsChanged: (in category 'dschange dispatch') -----
  applyInstVarsChanged: aChange
+ 
+ 	^ self buildClassChangePane: aChange 
+ 		message: 'Instance variables changed' 
+ 		showMeta: false	
- 	^ {
- 		(self makeTextLabel: 'Instance variables changed - ',  aChange timeStampString )
- 			frame: (0 at 0 corner: 1 @ 0.05); yourself.
  
+ !
- 		(self makeTextLabel: (
- 			self diffFrom: ((self getEditorFor: aChange) 
- 					instanceVariableNames: aChange oldVars; yourself) definition 
- 				to: (self getEditorFor: aChange) definition))
- 			frame: (0 at 0.05 corner: 1 @ 1);
- 			yourself.
- 	}!

Item was removed:
- ----- Method: DSDeltaInspector>>initialize (in category 'as yet unclassified') -----
- initialize
- 	chViewer := DSDeltaChangeViewer new!



More information about the Packages mailing list