Skip to content

Commit e2fd7ae

Browse files
committed
Databinding wasn't working for TCB mode
1 parent 36cf7bd commit e2fd7ae

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

base/uk.ac.stfc.isis.ibex.dae/src/uk/ac/stfc/isis/ibex/dae/experimentsetup/timechannels/XmlBackedTimeChannels.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ private void initialiseFromXml() {
132132

133133
index = Integer.parseInt(calculationMethod.getTextContent());
134134
super.setCalculationMethod(CalculationMethod.values()[index]);
135+
136+
System.out.println("Initializing from XML");
135137
}
136138

137139
private void updateNodes() throws XPathExpressionException {

base/uk.ac.stfc.isis.ibex.ui.dae/src/uk/ac/stfc/isis/ibex/ui/dae/experimentsetup/timechannels/TimeChannelsPanel.java

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,19 +190,28 @@ private void clearExistingTimeRegimeViews() {
190190
*
191191
* @param method the new calculation method
192192
*/
193-
private void setCalculationMethod(CalculationMethod method) {
193+
private void setCalculationMethod(final CalculationMethod method) {
194+
194195
viewModel.setCalculationMethod(method);
195-
switch (method) {
196-
case USE_TCB_FILE:
197-
radioUseTCBFile.setSelection(true);
198-
stack.topControl = tcbFilePanel;
199-
break;
200-
case SPECIFY_PARAMETERS:
201-
default:
202-
radioSpecifyParameters.setSelection(true);
203-
stack.topControl = timeRegimesPanel;
204-
break;
196+
System.out.println("hello I am in the code");
197+
try {
198+
Display.getDefault().syncExec(new Runnable(){
199+
@Override
200+
public void run() {
201+
System.out.println("im in the codez");
202+
radioSpecifyParameters.setSelection(viewModel.getCalculationMethod() == CalculationMethod.SPECIFY_PARAMETERS);
203+
radioUseTCBFile.setSelection(viewModel.getCalculationMethod() == CalculationMethod.USE_TCB_FILE);
204+
205+
stack.topControl = viewModel.getCalculationMethod() == CalculationMethod.USE_TCB_FILE ? tcbFilePanel : tcbSettingsSwitchPanel;
206+
207+
tcbSettingsSwitchPanel.layout();
208+
System.out.println("finish da codez");
209+
}
210+
});
211+
} catch (Throwable t) {
212+
t.printStackTrace();
205213
}
214+
206215
}
207216

208217
@SuppressWarnings("checkstyle:magicnumber")
@@ -228,7 +237,6 @@ public void widgetSelected(SelectionEvent e) {
228237
} else {
229238
setCalculationMethod(CalculationMethod.SPECIFY_PARAMETERS);
230239
}
231-
tcbSettingsSwitchPanel.layout();
232240
}
233241
};
234242
radioSpecifyParameters.addSelectionListener(listener);

0 commit comments

Comments
 (0)