Skip to content

Commit 2e42836

Browse files
authored
Merge pull request #635 from hernanmd/editable_inspector_values
Editable inspector values
2 parents fd4cb5b + ff70ca8 commit 2e42836

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/NewTools-Inspector/StRawInspectionPresenter.class.st

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,26 @@ StRawInspectionPresenter >> step [
171171
attributeTable updateRootsKeepingSelection: rootNodes
172172
]
173173

174+
{ #category : 'building' }
175+
StRawInspectionPresenter >> updatePresenterTitle [
176+
"Callback after changing a receiver's value (in a column for an instance variable). Update the window title and its header to display the new value"
177+
| wp |
178+
179+
wp := self window presenter.
180+
wp firstPage updateHeaderBar.
181+
self window title: wp windowTitle
182+
]
183+
174184
{ #category : 'building' }
175185
StRawInspectionPresenter >> valuesColumn [
176186

177187
^ SpStringTableColumn new
178188
title: 'Value';
179189
evaluated: #stringValue;
180-
"beEditable;"
190+
beEditable;
181191
onAcceptEdition: [ :node :value |
182-
self inform: node label , '=' , value asString "node value: value" ];
192+
self write: node value: value.
193+
self updatePresenterTitle ];
183194
sortFunction: #stringValue ascending;
184195
yourself
185196
]
@@ -200,3 +211,13 @@ StRawInspectionPresenter >> variablesColumn [
200211
sortFunction: #label ascending;
201212
yourself
202213
]
214+
215+
{ #category : 'writing' }
216+
StRawInspectionPresenter >> write: aStInspectorSlotNode value: aString [
217+
"Update the value of aStInspectorSlotNode with new value aString.
218+
Convert aString to the 'native' object parsing it as number or using parseLiterals (for booleans or strings)"
219+
220+
aStInspectorSlotNode slot
221+
write: (NumberParser parse: aString onError: [ aString parseLiterals first ])
222+
to: aStInspectorSlotNode hostObject
223+
]

0 commit comments

Comments
 (0)