}
};
Field maxTempChoiceField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_MAX), TEMPERATURES, maxTemperature, exec);
// Fan mode
EnumLabel fanModeLabel = EnumLabel.getEnumLabel(FAN_MODES, thermostatModel.getFanMode());
exec = new Execution() {
public boolean execute(Object selection) {
FanMode selectedFanMode = (FanMode) ((EnumLabel) selection).getEnumValue();
return thermostatModel.setFanMode(selectedFanMode);
}
};
Field fanModeField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_FAN_MODE), FAN_MODES, fanModeLabel, exec);
// Hold mode
EnumLabel holdModeLabel = EnumLabel.getEnumLabel(HOLD_MODES, thermostatModel.getHoldMode());
exec = new Execution() {
public boolean execute(Object selection) {
HoldMode selectedHoldMode = (HoldMode) ((EnumLabel) selection).getEnumValue();
return thermostatModel.setHoldMode(selectedHoldMode);
}
};
Field holdModeField = createLabelAndChoiceField(OmniLinkBBClient.getString(OmniLinkClientResource.TEMPERATURE_HOLD_MODE), HOLD_MODES, holdModeLabel, exec);
// System mode
EnumLabel systemModeLabel = EnumLabel.getEnumLabel(SYSTEM_MODES, thermostatModel.getSystemMode());
exec = new Execution() {
public boolean execute(Object selection) {
SystemMode selectedSystemMode = (SystemMode) ((EnumLabel) selection).getEnumValue();
return thermostatModel.setSystemMode(selectedSystemMode);
}