/** * Sets the receiver's hours. * <p> * Hours is an integer between 0 and 23. * </p> * * @param hours an integer between 0 and 23 * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void setHours( int hours ) { checkWidget(); if( checkTime( hours, getMinutes(), getSeconds() ) ) { rightNow.set( Calendar.HOUR_OF_DAY, hours ); applyLimits(); } }
/** * Sets the receiver's minutes. * <p> * Minutes is an integer between 0 and 59. * </p> * * @param minutes an integer between 0 and 59 * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void setMinutes( int minutes ) { checkWidget(); if( checkTime( getHours(), minutes, getSeconds() ) ) { rightNow.set( Calendar.MINUTE, minutes ); applyLimits(); } }
/** * Sets the receiver's seconds. * <p> * Seconds is an integer between 0 and 59. * </p> * * @param seconds an integer between 0 and 59 * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the * thread that created the receiver</li> * </ul> */ public void setSeconds( int seconds ) { checkWidget(); if( checkTime( getHours(), getMinutes(), seconds ) ) { rightNow.set( Calendar.SECOND, seconds ); applyLimits(); } }
/** * Sets the receiver's hours, minutes, and seconds in a single operation. * * @param hours an integer between 0 and 23 * @param minutes an integer between 0 and 59 * @param seconds an integer between 0 and 59 * * @exception SWTException <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that * created the receiver</li> * </ul> * * @since 1.2 */ public void setTime( int hours, int minutes, int seconds ) { checkWidget(); if( checkTime( hours, minutes, seconds ) ) { setHours( hours ); setMinutes( minutes ); setSeconds( seconds ); } }