.
"
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.
"
ChangesBrowser subclass:#ChangeSetBrowser
instanceVariableNames:'changeSet originalChangeSet'
classVariableNames:''
poolDictionaries:''
category:'Interface-Browsers'
!
ChangeSetBrowser comment:'
COPYRIGHT (c) 1993 by Claus Gittinger
All Rights Reserved
$Header: /cvs/stx/stx/libtool/Attic/ChgSetBrwsr.st,v 1.6 1995-08-10 13:13:39 claus Exp $
'!
!ChangeSetBrowser 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.
"
!
version
"
$Header: /cvs/stx/stx/libtool/Attic/ChgSetBrwsr.st,v 1.6 1995-08-10 13:13:39 claus Exp $
$Revision: 1.6 $
"
!
documentation
"
like a changesBrowser, but manipulates the per-project change-lists.
"
! !
!ChangeSetBrowser class methodsFor:'instance creation'!
openOn:aChangeSet
"create c changes browser on a change set"
^ ((self new label:'ChangeSet Browser') changeSet:aChangeSet) open
! !
!ChangeSetBrowser methodsFor:'initialize / release'!
initializeMiddleButtonMenu
|labels|
labels := resources array:#(
'apply change'
'apply changes to end'
'apply all changes'
'-'
'delete'
'delete to end'
'delete changes for this class to end'
'delete all changes for this class'
'-'
'update'
'compress'
'compare with current version'
'-'
'make change a patch'
'update sourcefile from change'
'-'
'saveback changeSet').
changeListView
middleButtonMenu:(PopUpMenu
labels:labels
selectors:#(
doApply
doApplyRest
doApplyAll
nil
doDelete
doDeleteRest
doDeleteClassRest
doDeleteClassAll
nil
doUpdate
doCompress
doCompare
nil
doMakePatch
doMakePermanent
nil
doSaveBack)
receiver:self
for:changeListView)
! !
!ChangeSetBrowser methodsFor:'private'!
queryCloseText
^ 'Quit without updating changeSet ?'
!
streamForChange:changeNr
"answer a stream for change"
|change|
change := changeSet at:changeNr.
change isNil ifTrue:[^nil].
^ ReadStream on:(change source)
!
changeSet:aChangeSet
originalChangeSet := aChangeSet.
changeSet := OrderedCollection new.
originalChangeSet notNil ifTrue:[
originalChangeSet do:[:aChange |
changeSet add:aChange
].
].
!
readChangesFileInBackground:dummy
"read the changeSet, create a list of header-lines"
changeSet size == 0 ifTrue:[^ nil].
self withCursor:(Cursor read) do:[
changeChunks := OrderedCollection new.
changeHeaderLines := OrderedCollection new.
changeSet do:[:aChange |
changeChunks add:(aChange printString).
changeHeaderLines add:(aChange printString)
].
changeClassNames := OrderedCollection new:(changeChunks size).
anyChanges := false
]
!
saveBackChanges
"save back the change set"
[originalChangeSet isEmpty] whileFalse:[
originalChangeSet removeLast
].
changeSet do:[:aChange |
originalChangeSet add:aChange
]
!
silentDeleteChange:changeNr
"delete a change do not update changeListView"
anyChanges := true.
changeChunks removeIndex:changeNr.
changeClassNames removeIndex:changeNr.
changeSet removeIndex:changeNr
! !
!ChangeSetBrowser methodsFor:'user actions'!
doSaveBack
anyChanges ifTrue:[
self saveBackChanges.
self doUpdate
]
! !