ChangeSetDiffComponent.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 19 Mar 2012 15:30:00 +0000
branchjv
changeset 3030 f89aa3cfedde
parent 3012 4f40b8304d54
child 3033 8964521a2c1b
permissions -rw-r--r--
Merge support

"
 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' }"

Object 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
    "Answers a changeset with containing all versionA changes"
    | cs |

    cs := ChangeSet new name: self versionALabel.
    self do:[:item|
        cs add: item versionA
    ].
    ^cs

    "Modified: / 16-12-2011 / 14:35:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

changesetB
    "Answers a changeset with containing all versionB changes"
    | cs |

    cs := ChangeSet new name: self versionBLabel.
    self do:[:item|
        cs add: item versionB
    ].
    ^cs

    "Modified: / 16-12-2011 / 14:35:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

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.
!

versionALabel
    ^ parent versionALabel

    "Created: / 09-11-2009 / 12:38:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

versionBLabel
    ^ parent versionBLabel

    "Created: / 09-11-2009 / 12:38:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!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
!

isMerged
    "raise an error: must be redefined in concrete subclass(es)"

    ^ self subclassResponsibility
! !

!ChangeSetDiffComponent class methodsFor:'documentation'!

version_CVS
    ^ '§Header: /cvs/stx/stx/libbasic3/ChangeSetDiffComponent.st,v 1.3 2011/12/19 08:37:48 vrany Exp §'
!

version_SVN
    ^ '$Id: ChangeSetDiffComponent.st 1896 2012-03-19 15:30:00Z vranyj1 $'
! !