ChangeSetDiffComponent.st
changeset 2406 cf06c39b234c
child 2424 bc7e320cec40
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ChangeSetDiffComponent.st	Wed Jul 06 13:46:34 2011 +0200
@@ -0,0 +1,175 @@
+"
+ Copyright (c) 2007-2010 Jan Vrany, SWING Research Group,
+                           Czech Technical University in Prague
+ Copyright (c) 2009-2010 eXept Software AG
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the 'Software'), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+"
+"{ Package: 'stx:libbasic3' }"
+
+Model subclass:#ChangeSetDiffComponent
+	instanceVariableNames:'parent'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'System-Changes-Diff'
+!
+
+!ChangeSetDiffComponent class methodsFor:'documentation'!
+
+copyright
+"
+ Copyright (c) 2007-2010 Jan Vrany, SWING Research Group,
+                           Czech Technical University in Prague
+ Copyright (c) 2009-2010 eXept Software AG
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the 'Software'), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+
+"
+! !
+
+!ChangeSetDiffComponent methodsFor:'accessing'!
+
+changesetA
+
+    ^ChangeSet withAll: (self flattened collect:[:each|each versionA])
+!
+
+changesetB
+
+    ^ChangeSet withAll: (self flattened collect:[:each|each versionB])
+!
+
+diffs
+
+    ^#()
+
+    "Created: / 10-11-2009 / 11:29:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+flattened
+
+    ^ChangeSetDiffSet new add: self
+
+    "Created: / 05-12-2009 / 11:07:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+merged
+    "raise an error: must be redefined in concrete subclass(es)"
+
+    ^ self subclassResponsibility
+!
+
+name
+    "raise an error: must be redefined in concrete subclass(es)"
+
+    ^ self subclassResponsibility
+!
+
+parent
+    ^ parent
+!
+
+parent:aDiffSet
+    parent := aDiffSet.
+! !
+
+!ChangeSetDiffComponent methodsFor:'change & update'!
+
+changed: aspect with: param
+
+    (aspect = #resolution and:[parent notNil])
+        ifTrue:[parent changed: aspect with: param].
+    super changed: aspect with: param.
+
+    "Created: / 24-11-2009 / 12:58:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffComponent methodsFor:'enumerating'!
+
+do: aBlock
+
+    self subclassResponsibility
+
+    "Created: / 25-11-2009 / 10:22:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffComponent methodsFor:'printing & storing'!
+
+printOn:aStream
+    "append a printed representation if the receiver to the argument, aStream"
+
+    super printOn:aStream.
+    aStream nextPut:$(.
+    self name printOn: aStream.
+    aStream nextPut:$).
+
+    "Modified: / 26-11-2009 / 16:25:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffComponent methodsFor:'private'!
+
+flattenOn: stream
+
+    ^stream nextPut: self
+
+    "Created: / 05-12-2009 / 11:06:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!ChangeSetDiffComponent methodsFor:'testing'!
+
+isDiffItem
+    ^ false
+!
+
+isDiffSet
+    ^ false
+!
+
+isEmpty
+
+    ^false
+! !
+
+!ChangeSetDiffComponent class methodsFor:'documentation'!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic3/ChangeSetDiffComponent.st,v 1.1 2011-07-06 11:46:34 vrany Exp $'
+! !