diff --git a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st index 9ae6842b..5cc72fc8 100644 --- a/src/Pyramid-Bloc/PyramidBlocPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocPlugin.class.st @@ -197,12 +197,6 @@ PyramidBlocPlugin class >> geometry [ ^ property ] -{ #category : #'class initialization' } -PyramidBlocPlugin class >> initialize [ - - PyramidPluginManager uniqueInstance addPlugin: self -] - { #category : #accessing } PyramidBlocPlugin class >> layout [ @@ -301,7 +295,7 @@ PyramidBlocPlugin >> addPanelsOn: aPyramidSimpleWindow [ addItem: [ :builder | self menuChangeOrderOn: builder ] ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidBlocPlugin >> connectOn: aPyramidEditor [ self editor: aPyramidEditor. diff --git a/src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st b/src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st index 41e2dab4..385fc993 100644 --- a/src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st @@ -46,12 +46,6 @@ PyramidBlocTextPlugin class >> fontWeight [ ^ property ] -{ #category : #'class initialization' } -PyramidBlocTextPlugin class >> initialize [ - - PyramidPluginManager uniqueInstance addPlugin: self -] - { #category : #accessing } PyramidBlocTextPlugin class >> textForeground [ @@ -67,7 +61,7 @@ PyramidBlocTextPlugin class >> textForeground [ ^ property ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidBlocTextPlugin >> connectOn: aPyramidEditor [ aPyramidEditor propertiesManager addProperty: self class changeText. diff --git a/src/Pyramid-Bloc/PyramidContextMenuPlugin.class.st b/src/Pyramid-Bloc/PyramidContextMenuPlugin.class.st index bd1a07b8..e259496a 100644 --- a/src/Pyramid-Bloc/PyramidContextMenuPlugin.class.st +++ b/src/Pyramid-Bloc/PyramidContextMenuPlugin.class.st @@ -12,6 +12,7 @@ Class { { #category : #'class initialization' } PyramidContextMenuPlugin class >> initialize [ + self flag:'labordep: Why remove before add ?'. PyramidPluginManager uniqueInstance removePlugin: self. PyramidPluginManager uniqueInstance addPlugin: self ] @@ -24,7 +25,7 @@ PyramidContextMenuPlugin >> addPanelsOn: aPyramidSimpleWindow [ self menuBrowseAndInspectOn: builder ] ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidContextMenuPlugin >> connectOn: aPyramidEditor [ self editor: aPyramidEditor. diff --git a/src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st b/src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st index 8c2b8009..80ee52d8 100644 --- a/src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st @@ -6,12 +6,6 @@ Class { #category : #'Pyramid-Bloc-plugin-copy-paste' } -{ #category : #'class initialization' } -PyramidCopyPastePlugin class >> initialize [ - - PyramidPluginManager uniqueInstance addPlugin: self -] - { #category : #adding } PyramidCopyPastePlugin >> addPanelsOn: aPyramidSimpleWindow [ diff --git a/src/Pyramid-Bloc/PyramidExistingOverlayError.class.st b/src/Pyramid-Bloc/PyramidExistingOverlayError.class.st index 8b2f13d4..2a039cc1 100644 --- a/src/Pyramid-Bloc/PyramidExistingOverlayError.class.st +++ b/src/Pyramid-Bloc/PyramidExistingOverlayError.class.st @@ -1,5 +1,5 @@ Class { #name : #PyramidExistingOverlayError, - #superclass : #Error, + #superclass : #PyramidError, #category : #'Pyramid-Bloc-plugin-space' } diff --git a/src/Pyramid-Bloc/PyramidSaveError.class.st b/src/Pyramid-Bloc/PyramidSaveError.class.st index c405f2e1..a26a5088 100644 --- a/src/Pyramid-Bloc/PyramidSaveError.class.st +++ b/src/Pyramid-Bloc/PyramidSaveError.class.st @@ -1,5 +1,5 @@ Class { #name : #PyramidSaveError, - #superclass : #Error, + #superclass : #PyramidError, #category : #'Pyramid-Bloc-plugin-save' } diff --git a/src/Pyramid-Bloc/PyramidSavePlugin.class.st b/src/Pyramid-Bloc/PyramidSavePlugin.class.st index 933cc930..7c7ee66f 100644 --- a/src/Pyramid-Bloc/PyramidSavePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSavePlugin.class.st @@ -15,12 +15,6 @@ Class { #category : #'Pyramid-Bloc-plugin-save' } -{ #category : #'class initialization' } -PyramidSavePlugin class >> initialize [ - - PyramidPluginManager uniqueInstance addPlugin: self -] - { #category : #'instance creation' } PyramidSavePlugin class >> openOn: aCollectionOfBlElement saveModel: aSaveModel [ @@ -51,7 +45,7 @@ PyramidSavePlugin >> addPanelsOn: aPyramidSimpleWindow [ builder makeButtonWithIcon: self inputsButton order: 2 ] ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidSavePlugin >> connectOn: aPyramidEditor [ self projectModel: aPyramidEditor projectModel. diff --git a/src/Pyramid-Bloc/PyramidSpacePlugin.class.st b/src/Pyramid-Bloc/PyramidSpacePlugin.class.st index 29508430..ee8ba982 100644 --- a/src/Pyramid-Bloc/PyramidSpacePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidSpacePlugin.class.st @@ -11,13 +11,6 @@ Class { #category : #'Pyramid-Bloc-plugin-space' } -{ #category : #'class initialization' } -PyramidSpacePlugin class >> initialize [ - PyramidPluginManager uniqueInstance addPlugin: self - - -] - { #category : #adding } PyramidSpacePlugin >> addPanelsOn: aPyramidSimpleWindow [ @@ -34,7 +27,7 @@ PyramidSpacePlugin >> builder [ ^ builder ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidSpacePlugin >> connectOn: aPyramidEditor [ builder editor: aPyramidEditor. diff --git a/src/Pyramid-Bloc/PyramidTreePlugin.class.st b/src/Pyramid-Bloc/PyramidTreePlugin.class.st index 0da26612..81fbcdd6 100644 --- a/src/Pyramid-Bloc/PyramidTreePlugin.class.st +++ b/src/Pyramid-Bloc/PyramidTreePlugin.class.st @@ -85,12 +85,6 @@ PyramidTreePlugin class >> columnZIndex: aPyramidTreePlugin [ yourself ] -{ #category : #'class initialization' } -PyramidTreePlugin class >> initialize [ - - PyramidPluginManager uniqueInstance addPlugin: self -] - { #category : #initialization } PyramidTreePlugin class >> setId: aString of: aBlElement onEditor: aPyramidEditor [ @@ -124,7 +118,7 @@ PyramidTreePlugin >> addPanelsOn: aPyramidSimpleWindow [ addItem: [ :builder | self menuAddAndDeleteOn: builder ] ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidTreePlugin >> connectOn: aPyramidEditor [ self editor: aPyramidEditor. diff --git a/src/Pyramid-IDE/PyramidWorld.class.st b/src/Pyramid-IDE/PyramidWorld.class.st index 78188cc6..56dbec19 100644 --- a/src/Pyramid-IDE/PyramidWorld.class.st +++ b/src/Pyramid-IDE/PyramidWorld.class.st @@ -4,6 +4,34 @@ Class { #category : #'Pyramid-IDE-Menus' } +{ #category : #actions } +PyramidWorld class >> displayLoadedPlugins [ + + | presenter stream | + presenter := SpTextPresenter new. + stream := ReadWriteStream on: String new. + + "Create loaded plugin list" + PyramidPluginManager uniqueInstance ifNotNil:[ :e | + + "Statistics" + stream + nextPutAll: (e pluginClasses size) asString; + nextPutAll: ' loaded plugin(s).'; + cr; cr. + + "Details" + e pluginClasses do:[ :p | + stream nextPutAll: '-' ; nextPutAll: p name; cr. + ]. + + ] ifNil:[stream nextPutAll: 'No loaded plugins.']. + + presenter text: stream contents. + presenter open. + presenter withWindowDo: [ :w | w title: 'Pyramid loaded plugins' ]. +] + { #category : #menu } PyramidWorld class >> menuBrowseSourcesOn: aBuilder [ @@ -30,6 +58,19 @@ PyramidWorld class >> menuGithubOn: aBuilder [ action: [ WebBrowser openOn: 'https://github.com/OpenSmock/Pyramid' ] ] +{ #category : #menu } +PyramidWorld class >> menuLoadedPluginsOn: aBuilder [ + + + (aBuilder item: #New) + parent: #PyramidDev; + order: 1.0; + action: [ self displayLoadedPlugins ]; + icon: (self iconNamed: #box); + help: 'Display all installed plugins'; + label: 'Loaded plugins' +] + { #category : #menu } PyramidWorld class >> menuNewOn: aBuilder [ @@ -68,11 +109,11 @@ PyramidWorld class >> menuRefreshPluginOn: aBuilder [ (aBuilder item: #New) parent: #PyramidDev; - order: 1.0; + order: 1.1; action: [ self startRefreshPlugins ]; icon: (self iconNamed: #refresh); - help: 'Reload all Pyramid plugins, use this to install a new plugin'; - label: 'Refresh plugins' + help: 'Reload all Pyramid plugins, use this for example to change installed plugin list'; + label: 'Reload plugins' ] { #category : #menu } diff --git a/src/Pyramid-Tests/PyramidPluginEditOnRunningTest.class.st b/src/Pyramid-Tests/PyramidPluginEditOnRunningTest.class.st new file mode 100644 index 00000000..0b57bcb8 --- /dev/null +++ b/src/Pyramid-Tests/PyramidPluginEditOnRunningTest.class.st @@ -0,0 +1,35 @@ +" +A PyramidPluginEditOnRunningTest is a test class for testing the behavior of PyramidPluginEditOnRunning +" +Class { + #name : #PyramidPluginEditOnRunningTest, + #superclass : #TestCase, + #instVars : [ + 'setting' + ], + #category : #'Pyramid-Tests-cases-plugin-edit-on-running' +} + +{ #category : #tests } +PyramidPluginEditOnRunningTest >> setUp [ + + super setUp. + setting := PyramidPluginEditOnRunning editOnRunning. +] + +{ #category : #tests } +PyramidPluginEditOnRunningTest >> tearDown [ + + PyramidPluginEditOnRunning editOnRunning: setting. + super tearDown. +] + +{ #category : #tests } +PyramidPluginEditOnRunningTest >> testEditOnRunning [ + + PyramidPluginEditOnRunning editOnRunning: true. + self assert: PyramidPluginEditOnRunning editOnRunning. + + PyramidPluginEditOnRunning editOnRunning: false. + self deny: PyramidPluginEditOnRunning editOnRunning. +] diff --git a/src/Pyramid/PyramidError.class.st b/src/Pyramid/PyramidError.class.st new file mode 100644 index 00000000..e75716ca --- /dev/null +++ b/src/Pyramid/PyramidError.class.st @@ -0,0 +1,5 @@ +Class { + #name : #PyramidError, + #superclass : #Error, + #category : #'Pyramid-core' +} diff --git a/src/Pyramid/PyramidEvent.class.st b/src/Pyramid/PyramidEvent.class.st new file mode 100644 index 00000000..c7ebff97 --- /dev/null +++ b/src/Pyramid/PyramidEvent.class.st @@ -0,0 +1,5 @@ +Class { + #name : #PyramidEvent, + #superclass : #Announcement, + #category : #'Pyramid-core' +} diff --git a/src/Pyramid/PyramidHistoryPlugin.class.st b/src/Pyramid/PyramidHistoryPlugin.class.st index 7387397c..dde8d092 100644 --- a/src/Pyramid/PyramidHistoryPlugin.class.st +++ b/src/Pyramid/PyramidHistoryPlugin.class.st @@ -12,12 +12,6 @@ Class { #category : #'Pyramid-history' } -{ #category : #'class initialization' } -PyramidHistoryPlugin class >> initialize [ - - PyramidPluginManager uniqueInstance addPlugin: self -] - { #category : #adding } PyramidHistoryPlugin >> addPanelsOn: aPyramidSimpleWindow [ @@ -31,7 +25,7 @@ PyramidHistoryPlugin >> addPanelsOn: aPyramidSimpleWindow [ builder makeButtonWithIcon: self redoButton order: 20 ] ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidHistoryPlugin >> connectOn: aPyramidEditor [ self history: aPyramidEditor propertiesManager history. diff --git a/src/Pyramid/PyramidPluginDynamicLayout.class.st b/src/Pyramid/PyramidPluginDynamicLayout.class.st index af086c3b..1a209533 100644 --- a/src/Pyramid/PyramidPluginDynamicLayout.class.st +++ b/src/Pyramid/PyramidPluginDynamicLayout.class.st @@ -13,12 +13,6 @@ Class { #category : #'Pyramid-plugin-dynamic-layout' } -{ #category : #initialization } -PyramidPluginDynamicLayout class >> initialize [ - - PyramidPluginManager uniqueInstance addPlugin: self -] - { #category : #adding } PyramidPluginDynamicLayout >> addPanelsOn: aPyramidWindow [ @@ -71,7 +65,7 @@ PyramidPluginDynamicLayout >> configureBuilder: aPyramidBuilder [ aPyramidBuilder window: editorWindow ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidPluginDynamicLayout >> connectOn: aPyramidEditor [ self changeEditorLayout diff --git a/src/Pyramid/PyramidPluginEditOnRunning.class.st b/src/Pyramid/PyramidPluginEditOnRunning.class.st new file mode 100644 index 00000000..1876e000 --- /dev/null +++ b/src/Pyramid/PyramidPluginEditOnRunning.class.st @@ -0,0 +1,66 @@ +Class { + #name : #PyramidPluginEditOnRunning, + #superclass : #Object, + #traits : 'TPyramidPlugin', + #classTraits : 'TPyramidPlugin classTrait', + #instVars : [ + 'editOnRunning' + ], + #classInstVars : [ + 'editOnRunning' + ], + #category : #'Pyramid-plugin-edit-on-running' +} + +{ #category : #accessing } +PyramidPluginEditOnRunning class >> editOnRunning [ + + ^ editOnRunning ifNil: [ editOnRunning := true ] +] + +{ #category : #accessing } +PyramidPluginEditOnRunning class >> editOnRunning: aBoolean [ + + editOnRunning := aBoolean +] + +{ #category : #initialization } +PyramidPluginEditOnRunning class >> install [ + "Do some stuff here when the plugin used class oriented behavior" + + self installBlUniverseListeners. +] + +{ #category : #'universe management' } +PyramidPluginEditOnRunning class >> installBlUniverseListeners [ + + BlParallelUniverse all do:[ :universe | + universe + when: BlParallelUniverseHostSpaceCreatedSignal + do:[ :e | self receiveBlParallelUniverseHostSpaceCreatedSignal: e ]. + ]. +] + +{ #category : #'universe management' } +PyramidPluginEditOnRunning class >> receiveBlParallelUniverseHostSpaceCreatedSignal: anEvent [ + + self editOnRunning ifFalse: [ ^ self ]. +] + +{ #category : #adding } +PyramidPluginEditOnRunning >> addPanelsOn: aPyramidSimpleWindow [ + + "do nothing" +] + +{ #category : #actions } +PyramidPluginEditOnRunning >> configureBuilder: aPyramidEditorBuilder [ + + "do nothing" +] + +{ #category : #connecting } +PyramidPluginEditOnRunning >> connectOn: aPyramidEditor [ + + "do nothing" +] diff --git a/src/Pyramid/PyramidPluginManager.class.st b/src/Pyramid/PyramidPluginManager.class.st index f4398a38..dbfcd26f 100644 --- a/src/Pyramid/PyramidPluginManager.class.st +++ b/src/Pyramid/PyramidPluginManager.class.st @@ -41,7 +41,10 @@ PyramidPluginManager class >> uniqueInstance [ { #category : #adding } PyramidPluginManager >> addPlugin: aPluginClass [ - self pluginClasses add: aPluginClass + self pluginClasses add: aPluginClass. + + "Install the class of the plugin when added" + aPluginClass install. ] { #category : #initialization } @@ -73,5 +76,8 @@ PyramidPluginManager >> pluginClasses [ { #category : #adding } PyramidPluginManager >> removePlugin: aPluginClass [ - self pluginClasses remove: aPluginClass ifAbsent: [ ] + self pluginClasses remove: aPluginClass ifAbsent: [ ]. + + "Uninstall the class of the plugin when added" + aPluginClass uninstall. ] diff --git a/src/Pyramid/PyramidPluginSelection.class.st b/src/Pyramid/PyramidPluginSelection.class.st index e4bc84e9..4b6ad465 100644 --- a/src/Pyramid/PyramidPluginSelection.class.st +++ b/src/Pyramid/PyramidPluginSelection.class.st @@ -10,12 +10,6 @@ Class { #category : #'Pyramid-plugin-selection' } -{ #category : #'as yet unclassified' } -PyramidPluginSelection class >> initialize [ - - PyramidPluginManager uniqueInstance addPlugin: self -] - { #category : #adding } PyramidPluginSelection >> addPanelsOn: aPyramidSimpleWindow [ @@ -27,7 +21,7 @@ PyramidPluginSelection >> addPanelsOn: aPyramidSimpleWindow [ order: 1 ]. ] -{ #category : #'as yet unclassified' } +{ #category : #connecting } PyramidPluginSelection >> connectOn: aPyramidEditor [ self view projectModel: aPyramidEditor projectModel diff --git a/src/Pyramid/TPyramidPlugin.trait.st b/src/Pyramid/TPyramidPlugin.trait.st index 99d2f4fd..e0179712 100644 --- a/src/Pyramid/TPyramidPlugin.trait.st +++ b/src/Pyramid/TPyramidPlugin.trait.st @@ -3,6 +3,24 @@ Trait { #category : #'Pyramid-core' } +{ #category : #initialization } +TPyramidPlugin classSide >> initialize [ +