Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-kfr.77.mcz
==================== Summary ====================
Name: HelpSystem-Core-kfr.77
Author: kfr
Time: 14 May 2015, 10:14:49.361 am
UUID: b5acbf22-bb99-744b-a8b7-9fa05787ddec
Ancestors: HelpSystem-Core-kfr.76
Replace a edited help topic in HelpBrowser with a new one.
There is still a bug that the updated topic changes place in the topic list
I'm also a little confused why there is two hierachies with the help topics in rootTopic and topLevelTopics
=============== Diff against HelpSystem-Core-kfr.76 ===============
Item was changed:
Model subclass: #HelpBrowser
+ instanceVariableNames: 'rootTopic currentTopic result searchTopic topicPath toplevelTopics oldTopic'
- instanceVariableNames: 'rootTopic currentTopic result searchTopic topicPath toplevelTopics'
classVariableNames: 'DefaultHelpBrowser'
poolDictionaries: ''
category: 'HelpSystem-Core-UI'!
!HelpBrowser commentStamp: 'tbn 3/8/2010 09:33' prior: 0!
A HelpBrowser is used to display a hierarchy of help topics and their contents.
Instance Variables
rootTopic: <HelpTopic>
window: <StandardWindow>
treeMorph: <PluggableTreeMorph>
contentMorph: <Morph>
rootTopic
- xxxxx
window
- xxxxx
treeMorph
- xxxxx
contentMorph
- xxxxx
!
Item was changed:
----- Method: HelpBrowser>>accept: (in category 'actions') -----
accept: text
"Accept edited text. Compile it into a HelpTopic"
| code topicClass topicMethod updatedTopic |
- "true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being']."
(self find: (self currentTopic contents copyFrom: 1 to: 20)) asArray
ifNotEmpty: [:refs |
topicClass := refs first actualClass theNonMetaClass.
topicMethod := refs first selector].
topicClass = nil ifTrue:[^self inform: 'This help topic can not be edited here'].
code := String streamContents:[:s|
s nextPutAll: topicMethod.
s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
s crtab; nextPutAll: '"', self name,' edit: ', topicMethod storeString,'"'.
s crtab; nextPutAll: '^HelpTopic'.
s crtab: 2; nextPutAll: 'title: ', currentTopic title storeString.
s crtab: 2; nextPutAll: 'contents: '.
s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
s nextPutAll:' readStream nextChunkText'.
].
+ topicClass class
- updatedTopic := topicClass class
compile: code
classified: ((topicClass class organization categoryOfElement: topicMethod) ifNil:['pages']).
+ updatedTopic := topicClass perform: topicMethod.
+ oldTopic := currentTopic.
+ "self inTopic: self rootTopic replaceCurrentTopicWith: updatedTopic".
+ self toplevelTopics do:[ :each | self inTopic: each replaceCurrentTopicWith: updatedTopic].
-
- self flag: #fixme. "mt: Update will not work because the topic builder eagerly cached all the contents and lost track of its origins. We need to get rid of the topic builders and create topic contents lazily resp. live."
- self currentTopic: updatedTopic.
self changed: #toplevelTopics..
self changed: #currentTopic.
self changed: #topicContents.
!
Item was added:
+ ----- Method: HelpBrowser>>inTopic:replaceCurrentTopicWith: (in category 'actions') -----
+ inTopic: parentTopic replaceCurrentTopicWith: aNewTopic
+
+ parentTopic subtopics
+ do: [ :sub | self inTopic: parentTopic replaceSubtopic: sub with: aNewTopic]!
Item was added:
+ ----- Method: HelpBrowser>>inTopic:replaceSubtopic:with: (in category 'actions') -----
+ inTopic: parentTopic replaceSubtopic: aTopic with: aNewTopic
+ | i |
+
+ (aTopic = oldTopic)
+ ifTrue: [ i := parentTopic subtopics indexOf: aTopic.
+ parentTopic subtopics at: i put: aNewTopic. ^self ].
+
+ aTopic subtopics
+ do: [ :sub | self inTopic: aTopic replaceSubtopic: sub with: aNewTopic]!
Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-kfr.77.mcz
==================== Summary ====================
Name: HelpSystem-Core-kfr.77
Author: kfr
Time: 14 May 2015, 10:14:49.361 am
UUID: b5acbf22-bb99-744b-a8b7-9fa05787ddec
Ancestors: HelpSystem-Core-kfr.76
Replace a edited help topic in HelpBrowser with a new one.
There is still a bug that the updated topic changes place in the topic list
I'm also a little confused why there is two hierachies with the help topics in rootTopic and topLevelTopics
=============== Diff against HelpSystem-Core-kfr.76 ===============
Item was changed:
Model subclass: #HelpBrowser
+ instanceVariableNames: 'rootTopic currentTopic result searchTopic topicPath toplevelTopics oldTopic'
- instanceVariableNames: 'rootTopic currentTopic result searchTopic topicPath toplevelTopics'
classVariableNames: 'DefaultHelpBrowser'
poolDictionaries: ''
category: 'HelpSystem-Core-UI'!
!HelpBrowser commentStamp: 'tbn 3/8/2010 09:33' prior: 0!
A HelpBrowser is used to display a hierarchy of help topics and their contents.
Instance Variables
rootTopic: <HelpTopic>
window: <StandardWindow>
treeMorph: <PluggableTreeMorph>
contentMorph: <Morph>
rootTopic
- xxxxx
window
- xxxxx
treeMorph
- xxxxx
contentMorph
- xxxxx
!
Item was changed:
----- Method: HelpBrowser>>accept: (in category 'actions') -----
accept: text
"Accept edited text. Compile it into a HelpTopic"
| code topicClass topicMethod updatedTopic |
- "true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being']."
(self find: (self currentTopic contents copyFrom: 1 to: 20)) asArray
ifNotEmpty: [:refs |
topicClass := refs first actualClass theNonMetaClass.
topicMethod := refs first selector].
topicClass = nil ifTrue:[^self inform: 'This help topic can not be edited here'].
code := String streamContents:[:s|
s nextPutAll: topicMethod.
s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
s crtab; nextPutAll: '"', self name,' edit: ', topicMethod storeString,'"'.
s crtab; nextPutAll: '^HelpTopic'.
s crtab: 2; nextPutAll: 'title: ', currentTopic title storeString.
s crtab: 2; nextPutAll: 'contents: '.
s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
s nextPutAll:' readStream nextChunkText'.
].
+ topicClass class
- updatedTopic := topicClass class
compile: code
classified: ((topicClass class organization categoryOfElement: topicMethod) ifNil:['pages']).
+ updatedTopic := topicClass perform: topicMethod.
+ oldTopic := currentTopic.
+ "self inTopic: self rootTopic replaceCurrentTopicWith: updatedTopic".
+ self toplevelTopics do:[ :each | self inTopic: each replaceCurrentTopicWith: updatedTopic].
-
- self flag: #fixme. "mt: Update will not work because the topic builder eagerly cached all the contents and lost track of its origins. We need to get rid of the topic builders and create topic contents lazily resp. live."
- self currentTopic: updatedTopic.
self changed: #toplevelTopics..
self changed: #currentTopic.
self changed: #topicContents.
!
Item was added:
+ ----- Method: HelpBrowser>>inTopic:replaceCurrentTopicWith: (in category 'actions') -----
+ inTopic: parentTopic replaceCurrentTopicWith: aNewTopic
+
+ parentTopic subtopics
+ do: [ :sub | self inTopic: parentTopic replaceSubtopic: sub with: aNewTopic]!
Item was added:
+ ----- Method: HelpBrowser>>inTopic:replaceSubtopic:with: (in category 'actions') -----
+ inTopic: parentTopic replaceSubtopic: aTopic with: aNewTopic
+ | i |
+
+ (aTopic = oldTopic)
+ ifTrue: [ i := parentTopic subtopics indexOf: aTopic.
+ parentTopic subtopics at: i put: aNewTopic. ^self ].
+
+ aTopic subtopics
+ do: [ :sub | self inTopic: aTopic replaceSubtopic: sub with: aNewTopic]!
Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-kfr.76.mcz
==================== Summary ====================
Name: HelpSystem-Core-kfr.76
Author: kfr
Time: 13 May 2015, 6:53:53.29 pm
UUID: fbad033b-7c29-0748-bdb5-02a02dff4cf7
Ancestors: HelpSystem-Core-kfr.75
Added a check/ bail out for non editable help topics
=============== Diff against HelpSystem-Core-kfr.75 ===============
Item was changed:
----- Method: HelpBrowser>>accept: (in category 'actions') -----
accept: text
"Accept edited text. Compile it into a HelpTopic"
| code topicClass topicMethod updatedTopic |
"true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being']."
(self find: (self currentTopic contents copyFrom: 1 to: 20)) asArray
+ ifNotEmpty: [:refs |
- ifNotEmpty: [:refs |
topicClass := refs first actualClass theNonMetaClass.
topicMethod := refs first selector].
+ topicClass = nil ifTrue:[^self inform: 'This help topic can not be edited here'].
-
code := String streamContents:[:s|
s nextPutAll: topicMethod.
s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
s crtab; nextPutAll: '"', self name,' edit: ', topicMethod storeString,'"'.
s crtab; nextPutAll: '^HelpTopic'.
s crtab: 2; nextPutAll: 'title: ', currentTopic title storeString.
s crtab: 2; nextPutAll: 'contents: '.
s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
s nextPutAll:' readStream nextChunkText'.
].
updatedTopic := topicClass class
compile: code
classified: ((topicClass class organization categoryOfElement: topicMethod) ifNil:['pages']).
self flag: #fixme. "mt: Update will not work because the topic builder eagerly cached all the contents and lost track of its origins. We need to get rid of the topic builders and create topic contents lazily resp. live."
self currentTopic: updatedTopic.
self changed: #toplevelTopics..
self changed: #currentTopic.
self changed: #topicContents.
!
Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-kfr.76.mcz
==================== Summary ====================
Name: HelpSystem-Core-kfr.76
Author: kfr
Time: 13 May 2015, 6:53:53.29 pm
UUID: fbad033b-7c29-0748-bdb5-02a02dff4cf7
Ancestors: HelpSystem-Core-kfr.75
Added a check/ bail out for non editable help topics
=============== Diff against HelpSystem-Core-kfr.75 ===============
Item was changed:
----- Method: HelpBrowser>>accept: (in category 'actions') -----
accept: text
"Accept edited text. Compile it into a HelpTopic"
| code topicClass topicMethod updatedTopic |
"true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being']."
(self find: (self currentTopic contents copyFrom: 1 to: 20)) asArray
+ ifNotEmpty: [:refs |
- ifNotEmpty: [:refs |
topicClass := refs first actualClass theNonMetaClass.
topicMethod := refs first selector].
+ topicClass = nil ifTrue:[^self inform: 'This help topic can not be edited here'].
-
code := String streamContents:[:s|
s nextPutAll: topicMethod.
s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
s crtab; nextPutAll: '"', self name,' edit: ', topicMethod storeString,'"'.
s crtab; nextPutAll: '^HelpTopic'.
s crtab: 2; nextPutAll: 'title: ', currentTopic title storeString.
s crtab: 2; nextPutAll: 'contents: '.
s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
s nextPutAll:' readStream nextChunkText'.
].
updatedTopic := topicClass class
compile: code
classified: ((topicClass class organization categoryOfElement: topicMethod) ifNil:['pages']).
self flag: #fixme. "mt: Update will not work because the topic builder eagerly cached all the contents and lost track of its origins. We need to get rid of the topic builders and create topic contents lazily resp. live."
self currentTopic: updatedTopic.
self changed: #toplevelTopics..
self changed: #currentTopic.
self changed: #topicContents.
!
Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-kfr.75.mcz
==================== Summary ====================
Name: HelpSystem-Core-kfr.75
Author: kfr
Time: 13 May 2015, 1:52:38.849 pm
UUID: 5b487f7f-b174-5343-894a-aff28511d4fa
Ancestors: HelpSystem-Core-mt.74
HelpBrowser>>accept: changed so it works. The changed topic is compiled but the current topic loaded in the HelpBrowser is not updated
=============== Diff against HelpSystem-Core-mt.74 ===============
Item was changed:
----- Method: HelpBrowser>>accept: (in category 'actions') -----
accept: text
"Accept edited text. Compile it into a HelpTopic"
+ | code topicClass topicMethod updatedTopic |
+ "true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being']."
+ (self find: (self currentTopic contents copyFrom: 1 to: 20)) asArray
+ ifNotEmpty: [:refs |
- | code topicClass topicMethod |
- true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being'].
- (self find: self topic contents) asArray ifNotEmpty: [:refs |
topicClass := refs first actualClass theNonMetaClass.
topicMethod := refs first selector].
code := String streamContents:[:s|
s nextPutAll: topicMethod.
s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
s crtab; nextPutAll: '"', self name,' edit: ', topicMethod storeString,'"'.
s crtab; nextPutAll: '^HelpTopic'.
s crtab: 2; nextPutAll: 'title: ', currentTopic title storeString.
s crtab: 2; nextPutAll: 'contents: '.
s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
s nextPutAll:' readStream nextChunkText'.
].
+ updatedTopic := topicClass class
- topicClass class
compile: code
classified: ((topicClass class organization categoryOfElement: topicMethod) ifNil:['pages']).
+
-
self flag: #fixme. "mt: Update will not work because the topic builder eagerly cached all the contents and lost track of its origins. We need to get rid of the topic builders and create topic contents lazily resp. live."
+ self currentTopic: updatedTopic.
-
self changed: #toplevelTopics..
self changed: #currentTopic.
self changed: #topicContents.
!
Marcel Taeumel uploaded a new version of HelpSystem-Core to project The Trunk:
http://source.squeak.org/trunk/HelpSystem-Core-kfr.75.mcz
==================== Summary ====================
Name: HelpSystem-Core-kfr.75
Author: kfr
Time: 13 May 2015, 1:52:38.849 pm
UUID: 5b487f7f-b174-5343-894a-aff28511d4fa
Ancestors: HelpSystem-Core-mt.74
HelpBrowser>>accept: changed so it works. The changed topic is compiled but the current topic loaded in the HelpBrowser is not updated
=============== Diff against HelpSystem-Core-mt.74 ===============
Item was changed:
----- Method: HelpBrowser>>accept: (in category 'actions') -----
accept: text
"Accept edited text. Compile it into a HelpTopic"
+ | code topicClass topicMethod updatedTopic |
+ "true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being']."
+ (self find: (self currentTopic contents copyFrom: 1 to: 20)) asArray
+ ifNotEmpty: [:refs |
- | code topicClass topicMethod |
- true ifTrue:[^self inform: 'Not implemented yet.', String cr, 'Make new help pages in the browser for the time being'].
- (self find: self topic contents) asArray ifNotEmpty: [:refs |
topicClass := refs first actualClass theNonMetaClass.
topicMethod := refs first selector].
code := String streamContents:[:s|
s nextPutAll: topicMethod.
s crtab; nextPutAll: '"This method was automatically generated. Edit it using:"'.
s crtab; nextPutAll: '"', self name,' edit: ', topicMethod storeString,'"'.
s crtab; nextPutAll: '^HelpTopic'.
s crtab: 2; nextPutAll: 'title: ', currentTopic title storeString.
s crtab: 2; nextPutAll: 'contents: '.
s cr; nextPutAll: (String streamContents:[:c| c nextChunkPutWithStyle: text]) storeString.
s nextPutAll:' readStream nextChunkText'.
].
+ updatedTopic := topicClass class
- topicClass class
compile: code
classified: ((topicClass class organization categoryOfElement: topicMethod) ifNil:['pages']).
+
-
self flag: #fixme. "mt: Update will not work because the topic builder eagerly cached all the contents and lost track of its origins. We need to get rid of the topic builders and create topic contents lazily resp. live."
+ self currentTopic: updatedTopic.
-
self changed: #toplevelTopics..
self changed: #currentTopic.
self changed: #topicContents.
!