Skip to content

Commit 4eeae90

Browse files
Merge pull request #228 from OpenSmock/dev-226
Dev #226
2 parents cf1e3bb + 011c6d6 commit 4eeae90

File tree

3 files changed

+52
-7
lines changed

3 files changed

+52
-7
lines changed

src/Molecule-Examples/MolMyUserFacadeComponentImpl.class.st

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Because I am a component implementation, you can force my automatic definition.
66
Class {
77
#name : #MolMyUserFacadeComponentImpl,
88
#superclass : #MolAbstractComponentImpl,
9-
#traits : 'MolMyUserFacadeComponent + MolMyLocalTimeEvents + MolMyAlarmSoundsEvents',
10-
#classTraits : 'MolMyUserFacadeComponent classTrait + MolMyLocalTimeEvents classTrait + MolMyAlarmSoundsEvents classTrait',
9+
#traits : 'MolMyUserFacadeComponent + MolMyAlarmSoundsEvents + MolMyLocalTimeEvents',
10+
#classTraits : 'MolMyUserFacadeComponent classTrait + MolMyAlarmSoundsEvents classTrait + MolMyLocalTimeEvents classTrait',
1111
#category : #'Molecule-Examples-Clock System Example'
1212
}
1313

src/Molecule-IDE-Tests/MolWorldTest.class.st

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ Class {
44
#category : #'Molecule-IDE-Tests-Cases'
55
}
66

7+
{ #category : #running }
8+
MolWorldTest >> testMenuDefinition [
9+
10+
self assert: (MolWorld menuDefinition: nil) isNil
11+
]
12+
13+
{ #category : #running }
14+
MolWorldTest >> testMenuKey [
15+
16+
self assert: MolWorld menuKey equals: #Molecule
17+
]
18+
719
{ #category : #tests }
820
MolWorldTest >> testOpenDefineComponentDialog [
921

@@ -12,6 +24,18 @@ MolWorldTest >> testOpenDefineComponentDialog [
1224
self assert: dialog notNil.
1325
]
1426

27+
{ #category : #running }
28+
MolWorldTest >> testOrder [
29+
30+
self assert: MolWorld order equals: 999
31+
]
32+
33+
{ #category : #running }
34+
MolWorldTest >> testParent [
35+
36+
self assert: MolWorld parent equals: #Tools
37+
]
38+
1539
{ #category : #tests }
1640
MolWorldTest >> testWorldMenu [
1741
| menuElements moleculeMenuEntry libraryMenu |

src/Molecule-IDE/MolWorld.class.st

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,23 @@ MolWorld class >> menu60ReportBugOn: aBuilder [
213213
action: [WebBrowser openOn: 'https://github.com/OpenSmock/Molecule/issues/new']
214214
]
215215

216+
{ #category : #'private - menu' }
217+
MolWorld class >> menuDefinition: aPragmaString [
218+
"Get a menu definition related to a pragme, if not found return nil"
219+
220+
| list |
221+
aPragmaString ifNil: [ ^ nil ].
222+
223+
list := Pragma allNamed: aPragmaString.
224+
225+
^ list ifEmpty: [ nil ] ifNotEmpty: [ :e |
226+
| pragma class |
227+
pragma := e first.
228+
class := pragma methodClass.
229+
(class instanceSide respondsTo: pragma methodSelector) ifTrue: [
230+
class instanceSide perform: pragma methodSelector ] ]
231+
]
232+
216233
{ #category : #'private - menu' }
217234
MolWorld class >> menuKey [
218235

@@ -232,18 +249,22 @@ MolWorld class >> openDefineComponentDialog [
232249
^ dialogWindow
233250
]
234251

235-
{ #category : #'private - menu' }
252+
{ #category : #'menu - definitions' }
236253
MolWorld class >> order [
237-
"Define the order of this World Menu, override me to change"
254+
"Define the order of the root of this World Menu, override me to change the it"
255+
256+
"Use this pragma to overidde me in a new method => <MoleculeOrderWorldMenuDefinition>"
238257

239-
^ 777
258+
^ (self menuDefinition: 'MoleculeOrderWorldMenuDefinition') ifNil: [ 999 ]
240259
]
241260

242-
{ #category : #'private - menu' }
261+
{ #category : #'menu - definitions' }
243262
MolWorld class >> parent [
244263
"Define the root parent of this World Menu, override me to change the location"
245264

246-
^ #Tools
265+
"Use this pragma to overidde me in a new method => <MoleculeParentWorldMenuDefinition>"
266+
267+
^ (self menuDefinition: 'MoleculeParentWorldMenuDefinition') ifNil: [ #Tools ]
247268
]
248269

249270
{ #category : #'menu - tools' }

0 commit comments

Comments
 (0)