newExpectedRangeLowText.hide();
}
});
newBaselineMeanText.setTitle(NEW_BASELINE_MEAN);
newBaselineMeanText.addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent blurEvent) {
hideBaselineEditingFields();
}
});
PickerIcon cancelPicker = new PickerIcon(PickerIcon.CLEAR, new FormItemClickHandler() {
public void onFormItemClick(FormItemIconClickEvent event) {
hideBaselineEditingFields();
}
});
newBaselineMeanText.setIcons(cancelPicker);
newBaselineMeanText.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent keyUpEvent) {
if (keyUpEvent.getKeyName().equals("Enter")) {
hideBaselineEditingFields();
if (null != newBaselineMeanText.getValueAsString()) {
double newBaselineMean = Double.parseDouble(newBaselineMeanText.getValueAsString());
saveCustomBaselineMean(newBaselineMean);
}
}
}
});
// High Baseline
expectedRangeHighText.setTitle(BASELINE_HIGH);
LinkItem baselineHighLink = AbstractActivityView.newLinkItem(CHANGE_VALUE, null);
baselineHighLink.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
// High cannot be below the low
newBaselineMeanText.hide();
newExpectedRangeHighText.show();
newExpectedRangeHighText.setSelectOnFocus(true);
newExpectedRangeLowText.hide();
}
});
newExpectedRangeHighText.setTitle(NEW_BASELINE_HIGH);
newExpectedRangeHighText.addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent blurEvent) {
hideBaselineEditingFields();
}
});
newExpectedRangeHighText.setIcons(cancelPicker);
newExpectedRangeHighText.addKeyUpHandler(new KeyUpHandler() {
@Override
public void onKeyUp(KeyUpEvent keyUpEvent) {
if (keyUpEvent.getKeyName().equals("Enter")) {
hideBaselineEditingFields();
if (null != newExpectedRangeHighText.getValueAsString()) {
double newBaselineHigh = Double.parseDouble(newExpectedRangeHighText.getValueAsString());
saveCustomBaselineHigh(newBaselineHigh);
}
}
}
});
// Low Baseline
expectedRangeLowText.setTitle(BASELINE_LOW);
LinkItem baselineLowLink = AbstractActivityView.newLinkItem(CHANGE_VALUE, null);
baselineLowLink.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent) {
newBaselineMeanText.hide();
newExpectedRangeHighText.hide();
newExpectedRangeLowText.show();
newExpectedRangeLowText.setSelectOnFocus(true);
}
});
newExpectedRangeLowText.setTitle(NEW_BASELINE_LOW);
newExpectedRangeLowText.addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent blurEvent) {
hideBaselineEditingFields();
}
});