-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathPyramidThemeFromSpaceExtension.class.st
More file actions
104 lines (79 loc) · 2.89 KB
/
PyramidThemeFromSpaceExtension.class.st
File metadata and controls
104 lines (79 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
Class {
#name : #PyramidThemeFromSpaceExtension,
#superclass : #Object,
#traits : 'TPyramidPlugin + TPyramidSpaceExtension + TPyramidEditorSpaceIsReadyObserver + TPyramidOpenFromSpacePluginExtension',
#classTraits : 'TPyramidPlugin classTrait + TPyramidSpaceExtension classTrait + TPyramidEditorSpaceIsReadyObserver classTrait + TPyramidOpenFromSpacePluginExtension classTrait',
#instVars : [
'defaultToTheme',
'themeSpaceSelector',
'spaceIsReady'
],
#category : #'Pyramid-Toplo-plugin-theme-management'
}
{ #category : #actions }
PyramidThemeFromSpaceExtension >> configureBuilder: aPyramidEditorBuilder [
| pyramidOpenFromSpacePlugin pyramidSpacePlugin pyramidToploThemePlugin |
[
pyramidOpenFromSpacePlugin := aPyramidEditorBuilder findPlugin:
PyramidOpenFromSpacePlugin.
pyramidSpacePlugin := aPyramidEditorBuilder findPlugin:
PyramidSpacePlugin.
pyramidToploThemePlugin := aPyramidEditorBuilder findPlugin:
PyramidToploThemePlugin ]
on: PyramidNoPluginFoundError
do: [ ^ self ].
pyramidOpenFromSpacePlugin addExtension: self.
pyramidSpacePlugin builder addExtension: self.
self themeSpaceSelector:
pyramidToploThemePlugin themePresenter themeSpaceSelector
]
{ #category : #'as yet unclassified' }
PyramidThemeFromSpaceExtension >> configureCloseOnSpace: aSpace [
aSpace toTheme: themeSpaceSelector currentTheme.
]
{ #category : #'as yet unclassified' }
PyramidThemeFromSpaceExtension >> configureOpenFromSpace: aSpace [
"Do something with the space"
self defaultToTheme: aSpace toTheme.
]
{ #category : #accessing }
PyramidThemeFromSpaceExtension >> defaultToTheme [
defaultToTheme ifNil: [ defaultToTheme := PyramidToploThemePlugin defaultTheme new ].
^ defaultToTheme
]
{ #category : #accessing }
PyramidThemeFromSpaceExtension >> defaultToTheme: anObject [
defaultToTheme := anObject.
self themeSpaceSelector selectTheme: anObject.
self spaceIsReady ifTrue: [ self informSpaceIsReady ].
]
{ #category : #'as yet unclassified' }
PyramidThemeFromSpaceExtension >> informSpaceIsReady [
self defaultToTheme ifNil: [ self spaceIsReady: true. ^ self ].
self builder space toTheme: self defaultToTheme
]
{ #category : #initialization }
PyramidThemeFromSpaceExtension >> initialize [
spaceIsReady := false.
]
{ #category : #displaying }
PyramidThemeFromSpaceExtension >> installOn: aBuilder [
self builder: aBuilder.
aBuilder addSpaceIsReadyObserver: self.
]
{ #category : #accessing }
PyramidThemeFromSpaceExtension >> spaceIsReady [
^ spaceIsReady
]
{ #category : #accessing }
PyramidThemeFromSpaceExtension >> spaceIsReady: anObject [
spaceIsReady := anObject
]
{ #category : #accessing }
PyramidThemeFromSpaceExtension >> themeSpaceSelector [
^ themeSpaceSelector
]
{ #category : #accessing }
PyramidThemeFromSpaceExtension >> themeSpaceSelector: anObject [
themeSpaceSelector := anObject
]