diff --git a/src/Molecule-Examples/MolMyUserFacadeComponentImpl.class.st b/src/Molecule-Examples/MolMyUserFacadeComponentImpl.class.st index 1dcadd2..4527b47 100644 --- a/src/Molecule-Examples/MolMyUserFacadeComponentImpl.class.st +++ b/src/Molecule-Examples/MolMyUserFacadeComponentImpl.class.st @@ -6,8 +6,8 @@ Because I am a component implementation, you can force my automatic definition. Class { #name : #MolMyUserFacadeComponentImpl, #superclass : #MolAbstractComponentImpl, - #traits : 'MolMyUserFacadeComponent + MolMyLocalTimeEvents + MolMyAlarmSoundsEvents', - #classTraits : 'MolMyUserFacadeComponent classTrait + MolMyLocalTimeEvents classTrait + MolMyAlarmSoundsEvents classTrait', + #traits : 'MolMyUserFacadeComponent + MolMyAlarmSoundsEvents + MolMyLocalTimeEvents', + #classTraits : 'MolMyUserFacadeComponent classTrait + MolMyAlarmSoundsEvents classTrait + MolMyLocalTimeEvents classTrait', #category : #'Molecule-Examples-Clock System Example' } diff --git a/src/Molecule-IDE-Tests/MolWorldTest.class.st b/src/Molecule-IDE-Tests/MolWorldTest.class.st index e32f245..6d96ebf 100644 --- a/src/Molecule-IDE-Tests/MolWorldTest.class.st +++ b/src/Molecule-IDE-Tests/MolWorldTest.class.st @@ -4,6 +4,18 @@ Class { #category : #'Molecule-IDE-Tests-Cases' } +{ #category : #running } +MolWorldTest >> testMenuDefinition [ + + self assert: (MolWorld menuDefinition: nil) isNil +] + +{ #category : #running } +MolWorldTest >> testMenuKey [ + + self assert: MolWorld menuKey equals: #Molecule +] + { #category : #tests } MolWorldTest >> testOpenDefineComponentDialog [ @@ -12,6 +24,18 @@ MolWorldTest >> testOpenDefineComponentDialog [ self assert: dialog notNil. ] +{ #category : #running } +MolWorldTest >> testOrder [ + + self assert: MolWorld order equals: 999 +] + +{ #category : #running } +MolWorldTest >> testParent [ + + self assert: MolWorld parent equals: #Tools +] + { #category : #tests } MolWorldTest >> testWorldMenu [ | menuElements moleculeMenuEntry libraryMenu | diff --git a/src/Molecule-IDE/MolWorld.class.st b/src/Molecule-IDE/MolWorld.class.st index c88b9a7..665f294 100644 --- a/src/Molecule-IDE/MolWorld.class.st +++ b/src/Molecule-IDE/MolWorld.class.st @@ -213,6 +213,23 @@ MolWorld class >> menu60ReportBugOn: aBuilder [ action: [WebBrowser openOn: 'https://github.com/OpenSmock/Molecule/issues/new'] ] +{ #category : #'private - menu' } +MolWorld class >> menuDefinition: aPragmaString [ + "Get a menu definition related to a pragme, if not found return nil" + + | list | + aPragmaString ifNil: [ ^ nil ]. + + list := Pragma allNamed: aPragmaString. + + ^ list ifEmpty: [ nil ] ifNotEmpty: [ :e | + | pragma class | + pragma := e first. + class := pragma methodClass. + (class instanceSide respondsTo: pragma methodSelector) ifTrue: [ + class instanceSide perform: pragma methodSelector ] ] +] + { #category : #'private - menu' } MolWorld class >> menuKey [ @@ -232,18 +249,22 @@ MolWorld class >> openDefineComponentDialog [ ^ dialogWindow ] -{ #category : #'private - menu' } +{ #category : #'menu - definitions' } MolWorld class >> order [ - "Define the order of this World Menu, override me to change" + "Define the order of the root of this World Menu, override me to change the it" + + "Use this pragma to overidde me in a new method => " - ^ 777 + ^ (self menuDefinition: 'MoleculeOrderWorldMenuDefinition') ifNil: [ 999 ] ] -{ #category : #'private - menu' } +{ #category : #'menu - definitions' } MolWorld class >> parent [ "Define the root parent of this World Menu, override me to change the location" - ^ #Tools + "Use this pragma to overidde me in a new method => " + + ^ (self menuDefinition: 'MoleculeParentWorldMenuDefinition') ifNil: [ #Tools ] ] { #category : #'menu - tools' }