• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

moosetechnology / MooseIDE / 18778893381

24 Oct 2025 11:51AM UTC coverage: 66.625% (+0.05%) from 66.573%
18778893381

push

github

web-flow
Merge pull request #1486 from moosetechnology/1485-MiAbstractRadioButton-setting-presenter-forces-to-use-4-buttons-per-row

fix radio button layout:

42 of 49 new or added lines in 3 files covered. (85.71%)

7 existing lines in 2 files now uncovered.

20725 of 31107 relevant lines covered (66.62%)

1.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

84.81
/src/MooseIDE-Core/MiAbstractRadioButtonSettingPresenter.class.st
1
Class {
2
        #name : 'MiAbstractRadioButtonSettingPresenter',
3
        #superclass : 'MiAbstractSettingPresenter',
4
        #instVars : [
5
                'selectedButton',
6
                'buttons'
7
        ],
8
        #category : 'MooseIDE-Core-Settings',
9
        #package : 'MooseIDE-Core',
10
        #tag : 'Settings'
11
}
12

13
{ #category : 'event handling' }
14
MiAbstractRadioButtonSettingPresenter >> activate: anItem [
15

16
        self subclassResponsibility
17
]
18

19
{ #category : 'adding' }
20
MiAbstractRadioButtonSettingPresenter >> addButton: aButton [
2✔
21

2✔
22
        self layout add: aButton
2✔
23
]
2✔
24

25
{ #category : 'adding' }
UNCOV
26
MiAbstractRadioButtonSettingPresenter >> addButton: button toRow: aBoxLayout [
×
UNCOV
27

×
UNCOV
28
        aBoxLayout add: button expand: false fill: false
×
UNCOV
29
]
×
30

31
{ #category : 'as yet unclassified' }
32
MiAbstractRadioButtonSettingPresenter >> beMultipleRows [
2✔
33
        "puts radioButtons on rows of up to 4 buttons (to the limit of 12 buttons)
2✔
34
         tries to put same number of radioButtons on each row"
2✔
35

2✔
36
        | nbRows rowLength currentRow buttonRows|
2✔
37
        self layout: self newBoxLayoutTopToBottom.
2✔
38
        
2✔
39
        nbRows := ((self items size) / 4) roundUpTo: 1.
2✔
40
        rowLength := ((self items size) / nbRows) roundUpTo: 1.
2✔
41
        
2✔
42
        buttonRows := Array new: nbRows.
2✔
43
        1 to: nbRows do: [ :i | | row |
2✔
44
                row := self newBoxLayoutLeftToRight.
2✔
45
                self layout add: row expand: false fill: false.
2✔
46
                buttonRows at: i put: row
2✔
47
        ].
2✔
48

2✔
49
        currentRow := 1.
2✔
50
        buttons do: [ :button |
2✔
51
                self addButton: button toRow: (buttonRows at: currentRow).
2✔
52
                (self rowSize: (buttonRows at: currentRow) isFull: rowLength) 
2✔
53
                        ifTrue: [ currentRow := currentRow + 1 ].
2✔
54
        ].
2✔
55
        
2✔
56
        
2✔
57
]
2✔
58

59
{ #category : 'building' }
60
MiAbstractRadioButtonSettingPresenter >> connectButtons [
2✔
61

2✔
62
        selectedButton
2✔
63
                associatedRadioButtons: buttons;
2✔
64
                state: true
2✔
65
]
2✔
66

67
{ #category : 'layout' }
68
MiAbstractRadioButtonSettingPresenter >> defaultLayout [
2✔
69

2✔
70
        ^ self newBoxLayoutTopToBottom 
2✔
71
]
2✔
72

73
{ #category : 'building' }
74
MiAbstractRadioButtonSettingPresenter >> helpForItem: anItem [
×
75

×
76
        ^ anItem printString
×
77
]
×
78

79
{ #category : 'initialization' }
80
MiAbstractRadioButtonSettingPresenter >> initializePresenters [
2✔
81

2✔
82
        buttons := self items collect: [ :item |
2✔
83
                                   | button |
2✔
84
                                   button := self newRadioButtonFor: item.
2✔
85
                                   self addButton: button.
2✔
86
                                   button ].
2✔
87

2✔
88
        self connectButtons
2✔
89
]
2✔
90

91
{ #category : 'testing' }
92
MiAbstractRadioButtonSettingPresenter >> isCurrentValue: anItem [
93

94
        self subclassResponsibility
95
]
96

97
{ #category : 'accessing' }
98
MiAbstractRadioButtonSettingPresenter >> items [
99

100
        ^ self subclassResponsibility 
101
]
102

103
{ #category : 'building' }
104
MiAbstractRadioButtonSettingPresenter >> labelForItem: anItem [
×
105

×
106
        ^ anItem printString
×
107
]
×
108

109
{ #category : 'instance creation' }
110
MiAbstractRadioButtonSettingPresenter >> newRadioButtonFor: anItem [
2✔
111

2✔
112
        | button |
2✔
113
        button := self newRadioButton.
2✔
114
        button
2✔
115
                label: (self labelForItem: anItem);
2✔
116
                help: (self helpForItem: anItem);
2✔
117
                whenActivatedDo: [ self activate: anItem ].
2✔
118

2✔
119
        (self isCurrentValue: anItem) ifTrue: [ selectedButton := button ].
2✔
120

2✔
121
        ^ button
2✔
122
]
2✔
123

124
{ #category : 'initialization' }
125
MiAbstractRadioButtonSettingPresenter >> rowSize: aBoxLayout isFull: maxSize [
2✔
126

2✔
127
        ^aBoxLayout children size >= maxSize 
2✔
128
]
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc