本文整理了Java中org.eclipse.swt.widgets.DateTime.getMinutes()
方法的一些代码示例,展示了DateTime.getMinutes()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateTime.getMinutes()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.DateTime
类名称:DateTime
方法名:getMinutes
[英]Returns the receiver's minutes.
Minutes is an integer between 0 and 59.
[中]返回接收器的分钟数。
分钟是介于0和59之间的整数。
代码示例来源:origin: org.xworker/xworker_swt
public static Object getValue(ActionContext actionContext){
DateTime dt = (DateTime) actionContext.get("control");
GregorianCalendar c = new GregorianCalendar();
c.set(Calendar.HOUR_OF_DAY, dt.getHours());
c.set(Calendar.MINUTE, dt.getMinutes());
c.set(Calendar.SECOND, dt.getSeconds());
Date time = c.getTime();
SimpleDateFormat sf = new SimpleDateFormat((String) actionContext.get("pattern"));
return sf.format(time);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.databinding
@Override
protected Object doGetValue(Object source) {
DateTime dateTime = (DateTime) source;
Calendar cal = (Calendar) calendar.get();
cal.clear();
if ((dateTime.getStyle() & SWT.TIME) != 0) {
cal.set(Calendar.HOUR_OF_DAY, dateTime.getHours());
cal.set(Calendar.MINUTE, dateTime.getMinutes());
cal.set(Calendar.SECOND, dateTime.getSeconds());
} else {
cal.set(Calendar.YEAR, dateTime.getYear());
cal.set(Calendar.MONTH, dateTime.getMonth());
cal.set(Calendar.DAY_OF_MONTH, dateTime.getDay());
}
return cal.getTime();
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
private void writeMinutes( final DateTime dateTime ) throws IOException {
Integer newValue = new Integer( dateTime.getMinutes() );
if( WidgetLCAUtil.hasChanged( dateTime, PROP_MINUTES, newValue ) ) {
JSWriter writer = JSWriter.getWriterFor( dateTime );
writer.set( PROP_MINUTES, newValue );
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* 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();
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* 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();
}
}
代码示例来源:origin: atdl4j/atdl4j
public DateTime getControlValueRaw()
{
if ( ( dateClock == null ) && ( timeClock == null ) )
{
return null; // disabled, no value to use
}
DateTime now = null;
if (useNowAsDate) now = new DateTime( DateTimeZone.getDefault() );
DateTime result = new DateTime( useNowAsDate ? now.getYear() : showMonthYear ? dateClock.getYear() : 1970,
useNowAsDate ? now.getMonthOfYear() : showMonthYear ? dateClock.getMonth() + 1 : 1,
useNowAsDate ? now.getDayOfMonth() : showDay ? dateClock.getDay() : 1,
showTime ? timeClock.getHours() : 0,
showTime ? timeClock.getMinutes() : 0,
showTime ? timeClock.getSeconds() : 0,
0,
DateTimeZone.getDefault() );
// Convert to UTC time for UTCTimestampT and UTCTimeOnlyT.
// Performing UTCDateT and MonthYearT coversion could produce an unexpected result.
// No conversion is needed for LocalMktTimeT, TZTimestampT, and TZTimeOnlyT.
if ( parameter == null || parameter instanceof UTCTimestampT || parameter instanceof UTCTimeOnlyT )
{
result = result.withZone( DateTimeZone.UTC );
logger.debug( "getControlValue() parameter: " + parameter + " result: " + result );
}
return result;
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt.q07
void preserveValues( final DateTime dateTime ) {
ControlLCAUtil.preserveValues( dateTime );
IWidgetAdapter adapter = WidgetUtil.getAdapter( dateTime );
boolean hasListeners = SelectionEvent.hasListener( dateTime );
adapter.preserve( Props.SELECTION_LISTENERS,
Boolean.valueOf( hasListeners ) );
adapter.preserve( PROP_HOURS,
new Integer( dateTime.getHours() ) );
adapter.preserve( PROP_MINUTES,
new Integer( dateTime.getMinutes() ) );
adapter.preserve( PROP_SECONDS,
new Integer( dateTime.getSeconds() ) );
preserveSubWidgetsBounds( dateTime );
WidgetLCAUtil.preserveCustomVariant( dateTime );
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
@Override
String getNameText() {
return (style & SWT.TIME) != 0 ? getHours() + ":" + getMinutes() + ":" + getSeconds()
: (getMonth() + 1) + "/" + getDay() + "/" + getYear();
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
String getNameText() {
return (style & SWT.TIME) != 0 ? getHours() + ":" + getMinutes() + ":" + getSeconds()
: (getMonth() + 1) + "/" + getDay() + "/" + getYear();
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
@Override
String getNameText () {
if (isTime ()) {
return getHours () + ":" + getMinutes () + ":" + getSeconds ();
} else {
return (getMonth () + 1) + "/" + getDay () + "/" + getYear ();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
@Override
String getNameText () {
if (isTime ()) {
return getHours () + ":" + getMinutes () + ":" + getSeconds ();
} else {
return (getMonth () + 1) + "/" + getDay () + "/" + getYear ();
}
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
@Override
String getNameText () {
if (isTime ()) {
return getHours () + ":" + getMinutes () + ":" + getSeconds ();
} else {
return (getMonth () + 1) + "/" + getDay () + "/" + getYear ();
}
}
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
void preserveValues( DateTime dateTime ) {
preserveProperty( dateTime, PROP_HOURS, dateTime.getHours() );
preserveProperty( dateTime, PROP_MINUTES, dateTime.getMinutes() );
preserveProperty( dateTime, PROP_SECONDS, dateTime.getSeconds() );
DateTimeLCAUtil.preserveSubWidgetsBounds( dateTime, getSubWidgetsBounds( dateTime ) );
DateTimeLCAUtil.preserveMinMaxLimit( dateTime );
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.team.ui
cal.set(Calendar.MINUTE, startTime.getMinutes());
cal.set(Calendar.SECOND, startTime.getSeconds());
schedule.setRefreshStartTime(cal.getTime());
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
@Override
void renderChanges( DateTime dateTime ) throws IOException {
DateTimeLCAUtil.renderChanges( dateTime );
renderProperty( dateTime, PROP_HOURS, dateTime.getHours(), SWT.DEFAULT );
renderProperty( dateTime, PROP_MINUTES, dateTime.getMinutes(), SWT.DEFAULT );
renderProperty( dateTime, PROP_SECONDS, dateTime.getSeconds(), SWT.DEFAULT );
DateTimeLCAUtil.renderSubWidgetsBounds( dateTime, getSubWidgetsBounds( dateTime ) );
DateTimeLCAUtil.renderMinMaxLimit( dateTime );
}
内容来源于网络,如有侵权,请联系作者删除!