- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {SimpleDateFormat s =
String pattern;new SimpleDateFormat(pattern)
String template;Locale locale;new SimpleDateFormat(template, locale)
new SimpleDateFormat()
- Smart code suggestions by Codota
}
private boolean validate(Double direction, Double angle) { boolean directionError = direction == null || direction < 0 || direction > 360; boolean angleError = angle == null || angle < 0 || angle > 90; ValidateUtil.setComponentError(getDirectionText(), directionError); ValidateUtil.setComponentError(getAngleText(), angleError); return !(directionError || angleError); }
private void fillForm(LightConfiguration light) { getDirectionText().setText("" + light.getDirection()); getAngleText().setText("" + light.getAngle()); getLblAmbientColor().setBackground(light.getAmbientColor()); getLblDiffuseColor().setBackground(light.getDiffuseColor()); }
@Override protected void onOk() { String directionText = getDirectionText().getText(); String angleText = getAngleText().getText(); Color ambientColor = getLblAmbientColor().getBackground(); Color diffuseColor = getLblDiffuseColor().getBackground(); Double direction = ParseUtil.parseDouble(directionText); Double angle = ParseUtil.parseDouble(angleText); if (validate(direction, angle)) { lightService.save(new LightConfiguration(direction, angle, ambientColor, diffuseColor)); // dispose(); } }