Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit on running plugin #112

Merged
merged 6 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/Pyramid-Bloc/PyramidBlocPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ PyramidBlocPlugin class >> geometry [
^ property
]

{ #category : #'class initialization' }
PyramidBlocPlugin class >> initialize [

PyramidPluginManager uniqueInstance addPlugin: self
]

{ #category : #accessing }
PyramidBlocPlugin class >> layout [

Expand Down Expand Up @@ -301,7 +295,7 @@ PyramidBlocPlugin >> addPanelsOn: aPyramidSimpleWindow [
addItem: [ :builder | self menuChangeOrderOn: builder ]
]

{ #category : #'as yet unclassified' }
{ #category : #connecting }
PyramidBlocPlugin >> connectOn: aPyramidEditor [

self editor: aPyramidEditor.
Expand Down
8 changes: 1 addition & 7 deletions src/Pyramid-Bloc/PyramidBlocTextPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@ PyramidBlocTextPlugin class >> fontWeight [
^ property
]

{ #category : #'class initialization' }
PyramidBlocTextPlugin class >> initialize [

PyramidPluginManager uniqueInstance addPlugin: self
]

{ #category : #accessing }
PyramidBlocTextPlugin class >> textForeground [

Expand All @@ -67,7 +61,7 @@ PyramidBlocTextPlugin class >> textForeground [
^ property
]

{ #category : #'as yet unclassified' }
{ #category : #connecting }
PyramidBlocTextPlugin >> connectOn: aPyramidEditor [

aPyramidEditor propertiesManager addProperty: self class changeText.
Expand Down
3 changes: 2 additions & 1 deletion src/Pyramid-Bloc/PyramidContextMenuPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand All @@ -24,7 +25,7 @@ PyramidContextMenuPlugin >> addPanelsOn: aPyramidSimpleWindow [
self menuBrowseAndInspectOn: builder ]
]

{ #category : #'as yet unclassified' }
{ #category : #connecting }
PyramidContextMenuPlugin >> connectOn: aPyramidEditor [

self editor: aPyramidEditor.
Expand Down
6 changes: 0 additions & 6 deletions src/Pyramid-Bloc/PyramidCopyPastePlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand Down
2 changes: 1 addition & 1 deletion src/Pyramid-Bloc/PyramidExistingOverlayError.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Class {
#name : #PyramidExistingOverlayError,
#superclass : #Error,
#superclass : #PyramidError,
#category : #'Pyramid-Bloc-plugin-space'
}
2 changes: 1 addition & 1 deletion src/Pyramid-Bloc/PyramidSaveError.class.st
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Class {
#name : #PyramidSaveError,
#superclass : #Error,
#superclass : #PyramidError,
#category : #'Pyramid-Bloc-plugin-save'
}
8 changes: 1 addition & 7 deletions src/Pyramid-Bloc/PyramidSavePlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand Down Expand Up @@ -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.
Expand Down
9 changes: 1 addition & 8 deletions src/Pyramid-Bloc/PyramidSpacePlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand All @@ -34,7 +27,7 @@ PyramidSpacePlugin >> builder [
^ builder
]

{ #category : #'as yet unclassified' }
{ #category : #connecting }
PyramidSpacePlugin >> connectOn: aPyramidEditor [

builder editor: aPyramidEditor.
Expand Down
8 changes: 1 addition & 7 deletions src/Pyramid-Bloc/PyramidTreePlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand Down Expand Up @@ -124,7 +118,7 @@ PyramidTreePlugin >> addPanelsOn: aPyramidSimpleWindow [
addItem: [ :builder | self menuAddAndDeleteOn: builder ]
]

{ #category : #'as yet unclassified' }
{ #category : #connecting }
PyramidTreePlugin >> connectOn: aPyramidEditor [

self editor: aPyramidEditor.
Expand Down
47 changes: 44 additions & 3 deletions src/Pyramid-IDE/PyramidWorld.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand All @@ -30,6 +58,19 @@ PyramidWorld class >> menuGithubOn: aBuilder [
action: [ WebBrowser openOn: 'https://github.com/OpenSmock/Pyramid' ]
]

{ #category : #menu }
PyramidWorld class >> menuLoadedPluginsOn: aBuilder [

<worldMenu>
(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 [

Expand Down Expand Up @@ -68,11 +109,11 @@ PyramidWorld class >> menuRefreshPluginOn: aBuilder [
<worldMenu>
(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 }
Expand Down
35 changes: 35 additions & 0 deletions src/Pyramid-Tests/PyramidPluginEditOnRunningTest.class.st
Original file line number Diff line number Diff line change
@@ -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.
]
5 changes: 5 additions & 0 deletions src/Pyramid/PyramidError.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Class {
#name : #PyramidError,
#superclass : #Error,
#category : #'Pyramid-core'
}
5 changes: 5 additions & 0 deletions src/Pyramid/PyramidEvent.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Class {
#name : #PyramidEvent,
#superclass : #Announcement,
#category : #'Pyramid-core'
}
8 changes: 1 addition & 7 deletions src/Pyramid/PyramidHistoryPlugin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ Class {
#category : #'Pyramid-history'
}

{ #category : #'class initialization' }
PyramidHistoryPlugin class >> initialize [

PyramidPluginManager uniqueInstance addPlugin: self
]

{ #category : #adding }
PyramidHistoryPlugin >> addPanelsOn: aPyramidSimpleWindow [

Expand All @@ -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.
Expand Down
8 changes: 1 addition & 7 deletions src/Pyramid/PyramidPluginDynamicLayout.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ Class {
#category : #'Pyramid-plugin-dynamic-layout'
}

{ #category : #initialization }
PyramidPluginDynamicLayout class >> initialize [

PyramidPluginManager uniqueInstance addPlugin: self
]

{ #category : #adding }
PyramidPluginDynamicLayout >> addPanelsOn: aPyramidWindow [

Expand Down Expand Up @@ -71,7 +65,7 @@ PyramidPluginDynamicLayout >> configureBuilder: aPyramidBuilder [
aPyramidBuilder window: editorWindow
]

{ #category : #'as yet unclassified' }
{ #category : #connecting }
PyramidPluginDynamicLayout >> connectOn: aPyramidEditor [

self changeEditorLayout
Expand Down
66 changes: 66 additions & 0 deletions src/Pyramid/PyramidPluginEditOnRunning.class.st
Original file line number Diff line number Diff line change
@@ -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"
]
Loading