Skip to content

Commit 0959dc6

Browse files
authored
spec layouts should now be on instance side (#27)
1 parent 11d0f03 commit 0959dc6

File tree

4 files changed

+53
-52
lines changed

4 files changed

+53
-52
lines changed

source/Teapot-Tools/TeaFormTab.class.st

+11-11
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@ Class {
1313
#tag : 'UI-Components'
1414
}
1515

16-
{ #category : 'specs' }
17-
TeaFormTab class >> defaultLayout [
18-
^ SpBoxLayout newVertical
19-
add: #form expand: false fill: false;
20-
add: (SpBoxLayout newHorizontal
21-
add: #addButton expand: false fill: false;
22-
hAlignCenter;
23-
yourself) expand: false fill: false;
24-
yourself
25-
]
26-
2716
{ #category : 'accessing' }
2817
TeaFormTab >> addButton [
2918
^ addButton
@@ -34,6 +23,17 @@ TeaFormTab >> connectPresenters [
3423
addButton whenActionPerformedDo: [ form addKey: 'key' value: 'value' ]
3524
]
3625

26+
{ #category : 'layout' }
27+
TeaFormTab >> defaultLayout [
28+
^ SpBoxLayout newVertical
29+
add: form expand: false fill: false;
30+
add: (SpBoxLayout newHorizontal
31+
add: addButton expand: false fill: false;
32+
hAlignCenter;
33+
yourself) expand: false fill: false;
34+
yourself
35+
]
36+
3737
{ #category : 'accessing' }
3838
TeaFormTab >> form [
3939
^ form

source/Teapot-Tools/TeaKeyValueInput.class.st

+10-9
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,6 @@ Class {
1414
#tag : 'UI-Components'
1515
}
1616

17-
{ #category : 'specs' }
18-
TeaKeyValueInput class >> defaultLayout [
19-
^ SpBoxLayout newHorizontal
20-
add: #keyInput expand: true fill: true padding: 5;
21-
add: #valueInput expand: true fill: true padding: 5;
22-
add: #removeButton expand: false fill: false padding: 5;
23-
vAlignStart;
24-
yourself
25-
]
2617

2718
{ #category : 'instance creation' }
2819
TeaKeyValueInput class >> key: keyString value: valueString removeAction: aBlock [
@@ -37,6 +28,16 @@ TeaKeyValueInput >> asAssociation [
3728
^ keyInput text -> valueInput text
3829
]
3930

31+
{ #category : 'layout' }
32+
TeaKeyValueInput >> defaultLayout [
33+
^ SpBoxLayout newHorizontal
34+
add: keyInput expand: true fill: true padding: 5;
35+
add: valueInput expand: true fill: true padding: 5;
36+
add: removeButton expand: false fill: false padding: 5;
37+
vAlignStart;
38+
yourself
39+
]
40+
4041
{ #category : 'initialization' }
4142
TeaKeyValueInput >> initializePresenters [
4243
keyInput := self newTextInput placeholder: 'key'; yourself.

source/Teapot-Tools/TeaRequestBodyTabs.class.st

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ Class {
1616
}
1717

1818
{ #category : 'layout' }
19-
TeaRequestBodyTabs class >> defaultLayout [
19+
TeaRequestBodyTabs >> defaultLayout [
2020
^ SpBoxLayout newVertical
21-
add: #label expand: false fill: false;
21+
add: label expand: false fill: false;
2222
spacing: 5;
23-
add: #requestBody expand: true fill: true;
23+
add: requestBody expand: true fill: true;
2424
yourself
2525
]
2626

source/Teapot-Tools/Teaspoon.class.st

+29-29
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,6 @@ Class {
1919
#tag : 'UI'
2020
}
2121

22-
{ #category : 'layout' }
23-
Teaspoon class >> defaultLayout [
24-
^ SpBoxLayout newVertical
25-
add: (SpBoxLayout newHorizontal
26-
vAlignCenter;
27-
add: #methodDropList expand: false fill: false;
28-
spacing: 5;
29-
add: #urlInput expand: true fill: true;
30-
yourself)
31-
expand: false fill: false padding: 10;
32-
add: #requestBody expand: true fill: true;
33-
add: (SpBoxLayout newHorizontal
34-
vAlignCenter;
35-
add: #contentTypeLabel expand: false fill: false;
36-
spacing: 5;
37-
add: #contentTypeDropList expand: true fill: true;
38-
yourself)
39-
expand: false fill: false;
40-
spacing: 10;
41-
add: #resultLabel expand: false fill: false;
42-
add: #resultText expand: true fill: true;
43-
add: (SpBoxLayout newHorizontal
44-
add: #execButton expand: false fill: false;
45-
hAlignCenter;
46-
yourself)
47-
expand: false fill: false;
48-
yourself
49-
]
50-
5122
{ #category : 'private - accessing' }
5223
Teaspoon class >> iconProvider [
5324

@@ -113,6 +84,35 @@ Teaspoon >> contentTypeLabel [
11384
^ contentTypeLabel
11485
]
11586

87+
{ #category : 'layout' }
88+
Teaspoon >> defaultLayout [
89+
^ SpBoxLayout newVertical
90+
add: (SpBoxLayout newHorizontal
91+
vAlignCenter;
92+
add: methodDropList expand: false fill: false;
93+
spacing: 5;
94+
add: urlInput expand: true fill: true;
95+
yourself)
96+
expand: false fill: false padding: 10;
97+
add: requestBody expand: true fill: true;
98+
add: (SpBoxLayout newHorizontal
99+
vAlignCenter;
100+
add: contentTypeLabel expand: false fill: false;
101+
spacing: 5;
102+
add: contentTypeDropList expand: true fill: true;
103+
yourself)
104+
expand: false fill: false;
105+
spacing: 10;
106+
add: resultLabel expand: false fill: false;
107+
add: resultText expand: true fill: true;
108+
add: (SpBoxLayout newHorizontal
109+
add: execButton expand: false fill: false;
110+
hAlignCenter;
111+
yourself)
112+
expand: false fill: false;
113+
yourself
114+
]
115+
116116
{ #category : 'accessing' }
117117
Teaspoon >> execButton [
118118
^ execButton

0 commit comments

Comments
 (0)