List of usage examples for com.google.gwt.user.client.ui ValueListBox getValue
public T getValue()
From source file:com.sciencegadgets.client.ui.LinkPrompt.java
License:Open Source License
boolean isValidSpec(Label label, TextBox textBox, ValueListBox<String> listBox) { Style labelStyle = label.getElement().getStyle(); if ("".equals(textBox.getValue()) && listBox.getValue() == null) { labelStyle.clearColor();//w w w . ja v a 2 s . com labelStyle.clearFontWeight(); return false; } boolean isValid; try { Double value = Double.parseDouble(textBox.getValue()); if (value > 0 && listBox.getValue() != null) { isValid = true; } else { isValid = false; } } catch (NumberFormatException e) { isValid = false; } if (isValid) { labelStyle.clearColor(); labelStyle.setFontWeight(FontWeight.BOLD); } else { labelStyle.setColor("red"); labelStyle.setFontWeight(FontWeight.BOLD); } return isValid; }