|
|
Class: ChangesBrowser
Object
|
+--GraphicsContext
|
+--DeviceGraphicsContext
|
+--GraphicsMedium
|
+--DisplaySurface
|
+--SimpleView
|
+--View
|
+--TopView
|
+--StandardSystemView
|
+--ChangesBrowser
|
+--ChangeSetBrowser
- Package:
- stx:libtool
- Category:
- Interface-Browsers
- Version:
- rev:
1.400
date: 2009/11/08 16:37:40
- user: cg
- file: ChangesBrowser.st directory: libtool
- module: stx stc-classLibrary: libtool
- Author:
- Claus Gittinger
this implements a browser for the changes-file (actually, it can display
any sourceFiles contents).
See the extra document 'doc/misc/cbrowser.doc' for how to use this browser.
written jan 90 by claus
This is a very old leftover class (The Merovingian has not yet detected this one ;-)
It will be completely replaced by the ChangeSetBrowser class in the near future.
[Class variables:]
CompressSnapshotInfo if true (the default), snapshot entries
are also compressed in the compress function.
Some users prefer them to be not compressed.
Set it to false for this.
Notice:
this needs a total rewrite, to build up a changeSet from the file
(which did not exist when the ChangesBrowser was originally written)
and manipulate that changeSet.
This way, we get a browser for any upcoming incore changeSets for
free. Also, this will put the chunk analyzation code into Change and
subclasses (where it belongs) and give a better encapsulation and
overall structure. Do not take this as an example for good style ;-)
The Change hierarchy is currently been completed, and the changes browser
will be adapted soon.
[Using the ChangesBrowser]
behavior
-
autoSelectNext
-
returning true here, makes a Delete operation automatically
select the next change
defaults
-
defaultIcon
-
return the browsers default window icon
-
defaultLabel
-
-
isVisualStartable
-
return true, if this application can be started via #open.
(to allow start of a change browser via double-click in the browser)
instance creation
-
new
-
create a new changes browser
-
openOn: aFilename
-
create a changes browser on a change file
menu specs
-
menuSpec
-
This resource specification was automatically generated
by the MenuEditor of ST/X.
private-changeFile access
-
readXMLChangesFrom: aStream inBackground: inBackground
-
read an XML source file (format as in campSmalltalk DTD)
-
readXMLChangesFromFile: changeFileName inBackground: inBackground
-
utilities
-
isXMLFile: aFilename
-
-
methodDefinitionSelectors
-
aspects
-
applyInOriginalNameSpace
-
-
applyNotInOriginalNameSpace
-
-
autoCompare
-
-
autoUpdate
-
enabled/disable automatic update from the change-file (for monitoring)
-
autoloadAsRequired
-
-
editingClassSource
-
-
hasMultiSelection
-
-
hasNoMultiSelection
-
-
hasNoSelection
-
-
hasSelection
-
-
hasSingleSelection
-
-
notEditingClassSource
-
-
notEditingClassSourceAndNotReadOnly
-
-
notReadOnly
-
-
readOnly: aBoolean
-
-
showingDiffs
-
-
showingDiffsDefault
-
-
theSingleSelection
-
-
updateChangeSet
-
compiler interface
-
wantChangeLog
-
sent by the compiler to ask if a changeLog entry should
be written when compiling. Return false here.
compiler interface-error handling
-
correctableError: aString position: relPos to: relEndPos from: aCompiler
-
compiler notifys us of an error - this should really not happen since
changes ought to be correct (did someone edit the changes file ??).
Show the bad change in the codeView and let codeView hilight the error;
no corrections allowed here therefore return false
-
correctableSelectorWarning: aString position: relPos to: relEndPos from: aCompiler
-
compiler notifys us of a warning
-
error: aString position: relPos to: relEndPos from: aCompiler
-
compiler notifys us of an error - this should really not happen since
changes ought to be correct (did someone edit the changes file ??).
Show the bad change in the codeView and let codeView hilight the error
-
unusedVariableWarning: aString position: relPos to: relEndPos from: aCompiler
-
compiler notifies us of a (or some) unused variables;
hilight the error (relPos to relEndPos) and show a Box asking for continue/correct/abort;
this method should return true to the compiler if user wants the error
to be corrected; false otherwise
-
warning: aString position: relPos to: relEndPos from: aCompiler
-
compiler notifys us of a warning - ignore it
event handling
-
handlesKeyPress: key inView: view
-
this method is reached via delegation: are we prepared to handle
a keyPress in some other view ?
-
keyPress: key x: x y: y view: view
-
this method is reached via delegation from the changeListView
help
-
showActivity: someMessage
-
some activityNotification to be forwarded to the user;
show it in the windows title area here.
initialization & release
-
autoCompareChanged
-
sent from the compare-toggle
-
changeListMenu
-
return the menu for the change (upper) list
-
destroy
-
destroy the receiver; make certain, that boxes are destroyed too
-
initialize
-
-
postRealize
-
-
pullDownMenu
-
return the top (pullDown) menu
-
setupTabSpec
-
-
update: what with: aParameter from: changedObject
-
menu actions
-
menuExit
-
-
openAboutThisApplication
-
opens an about box for this application.
-
openHTMLDocument: relativeDocPath
-
-
openSettingsDialog
-
-
showAboutSTX
-
private
-
autoSelect: changeNr
-
select a change
-
autoSelectLast
-
select the last change
-
autoSelectOrEnd: changeNr
-
select the next change or the last
-
beep
-
-
checkClassIsLoaded: aClass
-
check for and warn if a class is unloaded (helper for compare-change)
-
clearCodeView
-
clear the (lower) code view.
-
isChangeSetBrowser
-
-
makeDiffViewInvisible
-
-
makeDiffViewVisible
-
-
nameSpaceForApply
-
-
newLabel: how
-
-
oldSourceForParseTree: parseTree
-
-
parseExpression: chunk
-
-
parseExpression: text inNameSpace: nameSpace
-
-
queryCloseText
-
made this a method for easy redefinition in subclasses
-
selectedClassNames
-
-
setChangeList
-
extract type-information from changes and stuff into top selection
view
-
setSingleSelection: changeNr
-
-
showNotFound
-
-
sourceOfChange: changeNr
-
-
unselect
-
common unselect
-
withSelectedChangesDo: aBlock
-
just a helper, check for a selected change and evaluate aBlock
with busy cursor
-
withSelectedChangesInOrder: order do: aBlock
-
just a helper, check for a selected change and evaluate aBlock
with busy cursor
-
withSelectedChangesReverseDo: aBlock
-
just a helper, check for a selected change and evaluate aBlock
with busy cursor
-
withSingleSelectedChangeDo: aBlock
-
just a helper, check for a single selection, and evaluate aBlock
with busy cursor
private-change access
-
changeIsFollowupMethodChange: changeNr
-
return true, if a change is a followup change (i.e. a followup change
in a bunch of methodsFor-changes)
-
changeIsSnapShotInfo: changeNr
-
return true, if a change is a snapShot info chunk
-
classNameOfChange: changeNr
-
return the classname of a change
(for classChanges (i.e. xxx class), the non-metaClassName (i.e. xxx) is returned)
-
extractSelectorOfMethodChange: changeNr
-
return a method-changes selector, or nil if its not a methodChange
-
fullClassNameOfChange: changeNr
-
return the full classname of a change
(for classChanges (i.e. xxx class), a string ending in ' class' is returned.
-
numberOfChanges
-
-
ownerClassNameOfChange: changeNr
-
return the owner classname of a change
For a normal class, this is the className;
for a private class, this is the name of the owning class
-
realClassNameOfChange: changeNr
-
return the classname of a change.
- since parsing ascii methods is slow, keep result cached in
changeClassNames for the next query
-
selectorOfMethodChange: changeNr
-
return a method-changes selector, or nil if its not a methodChange
-
sourceOfMethodChange: changeNr
-
return a method-changes source code, or nil if its not a methodChange.
-
streamForChange: changeNr
-
answer a stream for change
private-changeFile access
-
changeFileName: aFileName
-
set the name of the changeFile
-
checkIfFileHasChanged
-
check if the changeFile has been modified since the last check;
install a timeout for rechecking after some time.
-
readChangesFile
-
read the changes file, create a list of header-lines (changeChunks)
and a list of chunk-positions (changePositions)
-
readChangesFileInBackground: inBackground
-
read the changes file, create a list of header-lines (changeChunks)
and a list of chunk-positions (changePositions).
Starting with 2.10.3, the entries are multi-col entries;
the cols are:
1 delta (only if comparing)
'+' -> new method (w.r.t. current state)
'-' -> removed method (w.r.t. current state)
'?' -> class does not exist currently
'=' -> change is the same as current methods source
'~' -> change is almost the same as current methods source
2 class/selector
3 type of change
doit
method
category change
4 timestamp
since comparing slows down startup time, it is now disabled by
default and can be enabled via a toggle.
-
writeBackChanges
-
write back the changes file. To avoid problems when the disk is full
or a crash occurs while writing (well, or someone kills us),
first write the stuff to a new temporary file. If this works ok,
rename the old change-file to a .bak file and finally rename the
tempfile back to the change-file.
That way, if anything happens, either the original file is left unchanged,
or we have at least a backup of the previous change file.
private-user interaction ops
-
appendChange: changeNr toFile: aFileNameOrFileNameString
-
append change to a file. return true if ok.
-
applyChange: changeNr
-
fileIn a change.
Answer true, if everything went ok.
-
compareCategoryChange: parseTree
-
-
compareChange: changeNr
-
compare a change with the current (in-image) version; show the result of the compare (as dialog)
-
compareChange: changeNr showResult: doShowResult
-
compare a change with current version.
Return the result of the compare (same -> true, different -> false, uncomparable -> nil).
If doShowResult is true, the outcome is shown in a dialog/diffViewer.
-
compareCommentChange: parseTree
-
-
compareInstanceVariableNamesChange: parseTree
-
-
comparePackageChange: parseTree
-
-
compareRemoveSelectorChange: parseTree
-
-
compressForClass: aClassNameOrNil
-
compress the change-set;
this replaces multiple method-changes by the last (i.e. the most recent) change.
If the class argument is nil, compress for all classes.
otherwise, only changes for that class are compressed.
-
compressForClass: aClassNameOrNil selector: selectorToCompressOrNil
-
compress the change-set;
this replaces multiple method-changes by the last (i.e. the most recent) change.
If the class argument is nil, compress for all classes.
otherwise, only changes for that class are compressed.
-
deleteChange: changeNr
-
delete a change
-
deleteChangesFrom: start to: stop
-
delete a range of changes
-
makeChangeAPatch: changeNr
-
append change to patchfile
-
makeChangePermanent: changeNr
-
rewrite the source file where change changeNr lies
-
silentDeleteChange: changeNr
-
delete a change do not update changeListView
-
silentDeleteChangesFor: aClassName from: start to: stop
-
delete changes for a given class in a range.
Return the number of deleted changes.
-
silentDeleteChangesFor: aClassName selector: selector from: start to: stop
-
delete changes for given class/selector in a range.
Return the number of deleted changes.
-
silentDeleteChangesForClassAndPrivateClasses: aClassName from: start to: stop
-
delete changes for a given class and its private classes in a range.
Return the number of deleted changes.
-
silentDeleteInternalChange: changeNr
-
delete a change do not update changeListView
-
updateDiffView
-
-
updateDiffViewFor: changeNr
-
termination
-
askIfChangesAreToBeWrittenBack
-
-
closeRequest
-
window manager wants us to go away
-
saveAndTerminate
-
update the changes file and quit.
Dont depend on this being sent, not all window managers
send it; instead, they simply destroy the view.
user interaction
-
askForSearch: msg initialAnswer: initial thenSearchUsing: searchBlock2 onCancel: cancelBlock
-
-
askForSearchString: msg initialAnswer: initial directionInto: aValueHolder
-
common code to open a search box
-
autoUpdate: aBoolean
-
enabled/disable automatic update from the change-file (for monitoring)
-
autoloadAsRequired: aBoolean
-
enabled/disable automatic load of unloaded classes
-
changeSelection: lineNrCollection
-
show a change in the codeView
-
classOfChange: changeNr
-
-
classOfChange: changeNr ifAbsent: exceptionBlock
-
answer the class that is subject to the chamge at changeNr.
The classes owning class may be autoloaded, if autoloadAsRequired is true.
-
doApply
-
user wants a change to be applied
-
doApplyAll
-
user wants all changes to be applied
-
doApplyClassFromBeginning
-
user wants all changes for this class from 1 to changeNr to be applied
-
doApplyClassRest
-
user wants all changes for this class from changeNr to be applied
-
doApplyFromBeginning
-
user wants all changes from 1 to changeNr to be applied
-
doApplyRest
-
apply all changes from changeNr to the end
-
doApplyToConflictOrEnd
-
apply all changes from changeNr to either a conflict (i.e. method exists)
or the end.
-
doBrowse
-
user wants a browser on the class of a change
-
doBrowseImplementors
-
open an implementors-browser
-
doBrowseSenders
-
user wants a browser on the class of a change
-
doCheckinAndDeleteClassAll
-
first checkin the selected changes class then delete all changes
for it.
-
doCompare
-
compare change with current system version
-
doCompareAndCompress
-
remove all changes, which are equivalent to the current image version
-
doCompress
-
compress the change-set; this replaces multiple method-changes by the last
(i.e. the most recent) change
-
doCompressClass
-
compress changes for the selected class.
this replaces multiple method-changes by the last (i.e. the most recent) change.
-
doCompressSelector
-
compress changes for the selected class & selector.
this replaces multiple method-changes by the last (i.e. the most recent) change.
-
doDelete
-
delete currently selected change(s)
-
doDeleteAndSelectPrevious
-
delete currently selected change(s)
-
doDeleteClassAll
-
delete all changes with same class as currently selected change
-
doDeleteClassAndPrivateClassesAll
-
delete all changes with same class and private classes
as currently selected change
-
doDeleteClassFromBeginning
-
delete changes with same class as currently selected change from the beginning
up to the selected change.
Useful to get rid of obsolete changes before a fileout or checkin entry.
-
doDeleteClassRest
-
delete rest of changes with same class as currently selected change
-
doDeleteClassSelectorAll
-
delete all changes with same class and selector as currently selected change
-
doDeleteFromBeginning
-
delete all changes from 1 to the current
-
doDeleteRest
-
delete all changes from current to the end
-
doFileoutAndDeleteClassAll
-
first fileOut the selected changes class then delete all changes
for it.
-
doMakePatch
-
user wants a change to be made a patch
- copy it over to the patches file
-
doMakePermanent
-
user wants a change to be made permanent
- rewrite the source file where this change has to go
-
doSave
-
user wants a change to be appended to a file
-
doSaveClass
-
user wants changes for some class from current to end to be appended to a file
-
doSaveClassAll
-
user wants changes for some class from current to end to be appended to a file
-
doSaveClassFrom: startNr
-
user wants changes from current to end to be appended to a file
-
doSaveClassRest
-
user wants changes for some class from current to end to be appended to a file
-
doSaveRest
-
user wants changes from current to end to be appended to a file
-
doUpdate
-
reread the changes-file
-
doWriteBack
-
write back the list onto the changes file
-
doubleClickOnChange: lineNr
-
action performed when a change-list entry is doubleClicked
-
findClass
-
findClass menu action: let user enter a classes name, and select the next change for that class
-
findFirstForClass
-
findNextForClass menu action: select the next change for the selected changes class
-
findLastForClass
-
findPreviousForClass menu action: select the previous change for the selected changes class
-
findLastSnapshot
-
findLastSnapshot menu action: select the last change which is for a snapShot-image save action
-
findNext
-
findNext menu action: select the next change.
Searches for what the last search was for; i.e. either same class or same selector
-
findNextDifference
-
-
findNextForClass
-
findNextForClass menu action: select the next change for the selected changes class
-
findNextForClassStartingAt: startNr
-
findNextForClass menu action: select the next change for the selected changes class
-
findNextForSelector
-
findNextForSelector menu action: select the next change for the selected changes selector
-
findNextForString
-
-
findNextForWhich: aBlock
-
helper: select the next change for which aBlock evaluates to true
-
findNextForWhich: aBlock startingAt: changeNrToStartSearch
-
helper: select the next change for which aBlock evaluates to true
-
findNextSnapshot
-
findNextSnapshot menu action: select the next change which is for a snapShot-image save action
-
findNextWithString: searchString
-
-
findPrevious
-
findPrevious menu action: select the previous change.
Searches for what the last search was for; i.e. either same class or same selector
-
findPreviousDifference
-
-
findPreviousForClass
-
findPreviousForClass menu action: select the previous change for the selected changes class
-
findPreviousForClassStartingAt: startNr
-
findPreviousForClass menu action: select the previous change for the selected changes class
-
findPreviousForSelector
-
findPreviousForSelector menu action: select the previous change for the selected changes selector
-
findPreviousForString
-
-
findPreviousForWhich: aBlock
-
helper: select the previous change for which aBlock evaluates to true
-
findPreviousForWhich: aBlock startingAt: changeNrToStartSearch
-
helper: select the previous change for which aBlock evaluates to true
-
findPreviousSnapshot
-
findPreviousSnapshot menu action: select the previous change which is for a snapShot-image save action
-
findPreviousWithString: searchString
-
-
findSelector
-
findSelector menu action: let user enter a selector, and select the next change for that selector
-
findString
-
-
noChangesAllowed
-
show a warning that changes cannot be changed
-
saveClass: aClassName from: startNr
-
user wants changes from current to end to be appended to a file
-
setEnforcedNameSpace
-
-
setEnforcedPackage
-
ChangeFileReader
ChangesBrowser open
|