| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 | Smalltalk current createPackage: 'Moka-Examples'!Object subclass: #MKCounterBuilder	instanceVariableNames: 'counter'	package: 'Moka-Examples'!!MKCounterBuilder methodsFor: 'accessing'!build	(MKLabelView model: self counter aspect: #count) render.	(MKButtonView model: self counter aspect: #increase) 		label: 'Increase';		render.	(MKInputView model: self counter aspect: #text)		render.	(MKTextAreaView model: self counter aspect: #text)		render.	(MKCheckboxView model: self counter aspect: #checked)		render.	(MKSwitchView model: self counter aspect: #checked)		render.	(MKButtonView model: self counter aspect: #decrease) 		label: 'Decrease';		render!counter	^ counter ifNil: [ counter := MKCounterModel new ]! !!MKCounterBuilder class methodsFor: 'initialization'!initialize	self new build! !MKModel subclass: #MKCounterModel	instanceVariableNames: 'count text checked'	package: 'Moka-Examples'!!MKCounterModel methodsFor: 'actions'!checked	^ checked ifNil: [ false ]!checked: aBoolean	checked := aBoolean.	self changed: 'checked'!count	^ count asString!decrease	count := count - 1.	self changed: #count!increase	count := count + 1.	self changed: #count!text	^ text ifNil: [ '' ]!text: aString	text := aString.	self changed: 'text'! !!MKCounterModel methodsFor: 'initialization'!initialize	super initialize.	count := 0! !
 |