[Pkg] SystemEditor: SystemEditor-mtf.105.mcz
squeaksource-noreply at iam.unibe.ch
squeaksource-noreply at iam.unibe.ch
Fri Jul 11 07:14:51 UTC 2008
A new version of SystemEditor was added to project SystemEditor:
http://www.squeaksource.com/SystemEditor/SystemEditor-mtf.105.mcz
==================== Summary ====================
Name: SystemEditor-mtf.105
Author: mtf
Time: 11 July 2008, 12:15:04 am
UUID: e7814739-a28b-47b3-a3b4-a00aec85ce64
Ancestors: SystemEditor-mtf.104
created AbstractEditor to handle editor classes in an extensible manner
=============== Diff against SystemEditor-mtf.104 ===============
Item was changed:
----- Method: SystemEditor>>at:ifAbsent: (in category 'reflecting') -----
at: aSymbol ifAbsent: aBlock
+ | newEditor |
(removals includes: aSymbol) ifTrue: [^ aBlock value].
editors at: aSymbol ifPresent: [:editor | ^ editor].
+ subject at: aSymbol ifPresent: [:obj |
+ newEditor := AbstractEditor on: obj for: self ifNotHandled: [^ obj].
+ ^ newEditor edRegisterEditor].
- subject at: aSymbol ifPresent:
- [:class |
- ^ class isBehavior
- ifTrue: [(ClassEditor on: class for: self) edRegisterEditor ]
- ifFalse: [class]].
^ aBlock value!
Item was changed:
+ AbstractEditor subclass: #ClassEditor
- Object subclass: #ClassEditor
instanceVariableNames: 'subject product system superEditor name type instVarNames classVarNames sharedPools methods category organization properties decorators'
classVariableNames: 'ReservedNames'
poolDictionaries: ''
category: 'SystemEditor-Editors'!
Item was added:
+ ----- Method: ClassEditor class>>canEdit:for: (in category 'instance creation') -----
+ canEdit: anObject for: anEditor
+ ^ anObject isBehavior!
Item was added:
+ ----- Method: ClassEditor class>>new (in category 'instance creation') -----
+ new
+ ^ MetaclassEditor new new!
Item was added:
+ ----- Method: ClassEditor>>on:for: (in category 'initialize-release') -----
+ on: aClass for: aSystemEditor
+ ^ self setSubject: aClass system: aSystemEditor!
Item was added:
+ ----- Method: AbstractEditor class>>canEdit: (in category 'as yet unclassified') -----
+ canEdit: anObject
+ ^ self canEdit: anObject for: nil!
Item was added:
+ ----- Method: AbstractEditor class>>on: (in category 'as yet unclassified') -----
+ on: anObject
+ ^ self on: anObject for: nil!
Item was added:
+ ----- Method: AbstractEditor class>>on:ifNotHandled: (in category 'as yet unclassified') -----
+ on: anObject ifNotHandled: aBlock
+ ^ self on: anObject for: nil ifNotHandled: aBlock!
Item was added:
+ ----- Method: AbstractEditor class>>canEdit:for: (in category 'as yet unclassified') -----
+ canEdit: anObject for: containerEditor
+ ^ false!
Item was added:
+ Object subclass: #AbstractEditor
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'SystemEditor-Editors'!
Item was added:
+ ----- Method: AbstractEditor class>>on:for:ifNotHandled: (in category 'as yet unclassified') -----
+ on: anObject for: collectionEditor ifNotHandled: aBlock
+ "Try to find the most specialized subclass willing to edit, for extensibility"
+ | editor |
+ self subclassesDo: [:class |
+ editor := class on: anObject for: collectionEditor ifNotHandled: [nil].
+ editor ifNotNil: [^ editor]].
+ (self canEdit: anObject for: collectionEditor) ifTrue: [^ self new on: anObject for: collectionEditor].
+ ^ aBlock value!
Item was added:
+ ----- Method: AbstractEditor class>>on:for: (in category 'as yet unclassified') -----
+ on: anObject for: collectionEditor
+ ^ self on: anObject for: collectionEditor ifNotHandled: [self error:
+ self class name, ' does not know how to edit ', anObject printString]!
Item was removed:
- ----- Method: ClassEditor class>>on: (in category 'instance creation') -----
- on: aClass
- ^ (self on: aClass for: SystemEditor new) edRegisterEditor !
Item was removed:
- ----- Method: ClassEditor class>>on:for: (in category 'instance creation') -----
- on: aClass for: aSystemEditor
- | meta instance |
- meta := MetaclassEditor new.
- instance := meta new.
- instance setSubject: aClass system: aSystemEditor.
- ^ instance!
More information about the Packages
mailing list