Skip to content
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
4 changes: 2 additions & 2 deletions src/Molecule-Examples/MolMyUserFacadeComponentImpl.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}

Expand Down
24 changes: 24 additions & 0 deletions src/Molecule-IDE-Tests/MolWorldTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand All @@ -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 |
Expand Down
31 changes: 26 additions & 5 deletions src/Molecule-IDE/MolWorld.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 [

Expand All @@ -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 => <MoleculeOrderWorldMenuDefinition>"

^ 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 => <MoleculeParentWorldMenuDefinition>"

^ (self menuDefinition: 'MoleculeParentWorldMenuDefinition') ifNil: [ #Tools ]
]

{ #category : #'menu - tools' }
Expand Down
Loading