Change.st
author james
Wed, 09 Apr 2003 14:26:50 +0200
changeset 1234 2edbb63a70b7
parent 1225 6e912daf6b1b
child 1288 a18544df474d
permissions -rw-r--r--
james' package changes

"
 COPYRIGHT (c) 1993 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

"{ Package: 'stx:libbasic3' }"

Object subclass:#Change
	instanceVariableNames:'source timeOfChangeIfKnown'
	classVariableNames:''
	poolDictionaries:''
	category:'System-Changes'
!

!Change class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1993 by Claus Gittinger
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    abstract superclass for all kind of changes - managed in changeSets.

    [author:]
        Claus Gittinger
"
! !

!Change methodsFor:'accessing'!

changeClass
    "the class of the change (nil if not present)"

    ^ nil

!

changeSelector
    ^ nil

    "Created: / 6.2.1998 / 13:29:35 / cg"
!

className
    "the className of the change"

    ^ nil

    "Modified: / 15.7.1996 / 09:26:34 / cg"
    "Created: / 6.2.1998 / 13:06:56 / cg"
!

file
    ^ nil "/ to be added as instvar
!

file:aFile position:anInteger
    ^ self "/ to be added 
!

objectType:aSymbol
    ^ self "/ to be added as instvar
!

prettyPrintedSource
    "return the prettyPrinted or normal source of the change"

    ^ self source
!

selector
    ^ nil

    "Created: / 6.2.1998 / 13:29:35 / cg"
!

source
    "return the source of the change"

    |s|

    source isNil ifTrue:[
        s := '' writeStream.
        self printOn:s.
        ^ s contents.
    ].
    ^ source

    "Modified: 15.7.1996 / 09:26:34 / cg"
!

source:someString
    "set the source of the change"

    source := someString

    "Modified: / 15.7.1996 / 09:26:34 / cg"
    "Created: / 16.2.1998 / 13:05:16 / cg"
!

timeOfChangeIfKnown
    ^ timeOfChangeIfKnown
!

timeStamp:aTimestamp
    timeOfChangeIfKnown := aTimestamp
! !

!Change methodsFor:'applying'!

apply
    "apply the change"

    self subclassResponsibility
! !

!Change methodsFor:'change notification'!

sendChangeNotificationThroughSmalltalk
    "intentionally left blank"
! !

!Change methodsFor:'comparing'!

isForSameAs:changeB
    "return true, if the given change represents a change for the same
     thingy as the receiver (i.e. same method, same definition etc.)."

    ^ false

!

sameAs:changeB
    "return true, if the given change represents the same change as the receiver."

    ^ false

!

sameSourceAs:changeB
    "return true, if the given change has the same source as the receiver."

    |sourceA sourceB|

    (sourceA := self source) = (sourceB := changeB source) ifTrue:[^ true].

    sourceA := sourceA withoutTrailingSeparators asCollectionOfLines.
    sourceB := sourceB withoutTrailingSeparators asCollectionOfLines.
    sourceA size ~~ sourceB size ifTrue:[^ false].
    sourceA := sourceA collect:[:line | line withTabsExpanded withoutTrailingSeparators].
    sourceB := sourceB collect:[:line | line withTabsExpanded withoutTrailingSeparators].
    ^ sourceA = sourceB 
! !

!Change methodsFor:'printing & storing'!

printStringWithoutClassName
    |s|

    s := '' writeStream.
    self printWithoutClassNameOn:s.
    ^ s contents


!

printWithoutClassNameOn:aStream
    self printOn:aStream


! !

!Change methodsFor:'queries'!

isClassCategoryChange
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isClassChange
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isClassCommentChange
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isClassDefinitionChange
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isClassInstVarDefinitionChange
    ^ false

!

isClassRemoveChange
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isClassRenameChange
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isDoIt
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isMethodCategoryChange
    ^ false
!

isMethodCategoryRenameChange
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isMethodChange
    ^ false

    "Created: / 7.2.1998 / 19:26:50 / cg"
!

isMethodDefinitionChange
    ^ false
!

isMethodRemoveChange
    ^ false
!

isPrimitiveChange
    ^ false

!

isPrimitiveDefinitionsChange
    ^ false

!

isPrimitiveFunctionsChange
    ^ false

!

isPrimitiveVariablesChange
    ^ false

! !

!Change class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic3/Change.st,v 1.38 2003-04-09 12:26:50 james Exp $'
! !