}
private TimeEditor setTime(int hours, int minutes, int seconds, SetValueBy by) {
TimeSign timeSign = null;
TimeSpinner<Integer> actSecondsSpinner = getSecondsSpinner();
TimeSignSpinner acttimeSignSpinner = getTimeSignSpinner();
if (acttimeSignSpinner != null) {//there is a time sign spinner, --> fix the hours
timeSign = TimeSign.AM;
if (hours >= 12) {
timeSign = TimeSign.PM;
}
if (hours > 12) {//>12h -> XXh pm
hours -= 12;
}
if (hours == 0) {//00:xx -> 12:xx am
hours = 12;
}
}
getHoursSpinner().setValueBy(hours, by);
getMinutesSpinner().setValueBy(minutes, by);
if (actSecondsSpinner != null) {
actSecondsSpinner.setValueBy(seconds, by);
}
if (acttimeSignSpinner != null) {
acttimeSignSpinner.setValueBy(timeSign, by);
}
return this;
}