A new version of Monticello was added to project The Inbox:
http://source.squeak.org/inbox/Monticello-tfel.395.mcz ==================== Summary ==================== Name: Monticello-tfel.395 Author: tfel Time: 12 June 2010, 3:07:04.233 pm UUID: f16ae641-3d13-4861-9e69-be66aac30293 Ancestors: Monticello-nice.394 Add a hook to allow other packages to add to the monticello browser context menu. =============== Diff against Monticello-nice.394 =============== Item was added: + ----- Method: MCMenuSpec>>= (in category 'comparing') ----- + = aMCMenuSpec + + ^ self class == aMCMenuSpec class and: [self entry = aMCMenuSpec entry].! Item was changed: ----- Method: MCWorkingCopyBrowser>>workingCopyListMenu: (in category 'morphic ui') ----- workingCopyListMenu: aMenu workingCopy ifNil: [^ aMenu]. self fillMenu: aMenu fromSpecs: #(('add required package' #addRequiredPackage) ('clear required packages' #clearRequiredPackages) ('browse package' #browseWorkingCopy) ('view changes' #viewChanges) ('view history' #viewHistory) ('recompile package' #recompilePackage) ('revert package...' #revertPackage) ('unload package' #unloadPackage) ('delete working copy' #deleteWorkingCopy)). (Smalltalk includesKey: #SARMCPackageDumper) ifTrue: [ aMenu add: 'make SAR' target: self selector: #fileOutAsSAR ]. + self insertExternalMenuEntries: aMenu. ^aMenu! Item was added: + ----- Method: MCMenuSpec>>entry (in category 'accessing') ----- + entry + + ^entry! Item was added: + ----- Method: MCMenuSpec>>selector: (in category 'accessing') ----- + selector: anObject + + selector := anObject! Item was added: + ----- Method: MCMenuSpec>>selector (in category 'accessing') ----- + selector + + ^selector! Item was added: + ----- Method: MCMenuSpec>>target: (in category 'accessing') ----- + target: anObject + + target := anObject! Item was added: + Object subclass: #MCMenuSpec + instanceVariableNames: 'entry target selector' + classVariableNames: '' + poolDictionaries: '' + category: 'Monticello-UI'! + + !MCMenuSpec commentStamp: 'tfel 6/12/2010 14:57' prior: 0! + A MCMenuSpec holds information to add menu entries to the monticello browser menus from external classes. + Required is the entry string (#entry), the call target and the selector be called. + An external class may use the MCWorkingCopyBrowser class>>addMenuSpec: method to add it's own menu entry to the monticello browser context menu. + + Note that MCMenuSpecs are compared via their menu entry string and if multiple MCMenuSpecs are added to the MCWorkingCopyBrowser, the last one takes precedence.! Item was changed: MCTool subclass: #MCWorkingCopyBrowser instanceVariableNames: 'workingCopy workingCopyWrapper repository defaults' + classVariableNames: 'CheckForNewerVersionsBeforeSave ExternalMenuEntries' - classVariableNames: 'CheckForNewerVersionsBeforeSave' poolDictionaries: '' category: 'Monticello-UI'! Item was added: + ----- Method: MCWorkingCopyBrowser class>>addMenuSpec: (in category 'hooks') ----- + addMenuSpec: aMCMenuSpec + "Register a context menu entry in the monticello browser from an external package. + The MCWorkingCopyBrowser model is passed as argument." + self externalMenuEntries + remove: aMCMenuSpec + ifAbsent: ["Remove any previous entry with description string"]; + add: aMCMenuSpec.! Item was added: + ----- Method: MCWorkingCopyBrowser>>insertExternalMenuEntries: (in category 'morphic ui') ----- + insertExternalMenuEntries: aMenu + + self class externalMenuEntries ifNotEmpty: [ + aMenu addLine. + self class externalMenuEntries do: [:each | + aMenu + add: each entry + target: each target + selector: each selector + argument: self]].! Item was added: + ----- Method: MCMenuSpec>>target (in category 'accessing') ----- + target + + ^target! Item was added: + ----- Method: MCWorkingCopyBrowser class>>externalMenuEntries (in category 'hooks') ----- + externalMenuEntries + + ExternalMenuEntries ifNil: [ExternalMenuEntries := Set new]. + ^ ExternalMenuEntries! Item was changed: SystemOrganization addCategory: #'Monticello-Base'! SystemOrganization addCategory: #'Monticello-Chunk Format'! SystemOrganization addCategory: #'Monticello-Loading'! SystemOrganization addCategory: #'Monticello-Merging'! SystemOrganization addCategory: #'Monticello-Modeling'! SystemOrganization addCategory: #'Monticello-Patching'! SystemOrganization addCategory: #'Monticello-Repositories'! SystemOrganization addCategory: #'Monticello-Storing'! SystemOrganization addCategory: #'Monticello-UI'! SystemOrganization addCategory: #'Monticello-Versioning'! + SystemOrganization addCategory: #'Monticello-Mocks'! Item was added: + ----- Method: MCMenuSpec>>entry: (in category 'accessing') ----- + entry: anObject + + entry := anObject! Item was added: + ----- Method: MCMenuSpec>>hash (in category 'comparing') ----- + hash + + ^ self entry hash! |
Free forum by Nabble | Edit this page |