org.eclipse.swt.widgets.DateTime.setYear()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中org.eclipse.swt.widgets.DateTime.setYear()方法的一些代码示例,展示了DateTime.setYear()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DateTime.setYear()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.DateTime
类名称:DateTime
方法名:setYear

DateTime.setYear介绍

[英]Sets the receiver's year.

The first year is 1752 and the last year is 9999. If the specified year is not valid for the receiver's day and month, then it is ignored.
[中]设置接收者的年份。
第一年是1752年,最后一年是9999年。如果指定的年份对于接收方的日期和月份无效,则忽略该年份。

代码示例

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

/**
 * @since 3.3
 */
public void setDate(Calendar date, boolean notifyListeners) {
  this.date = date;
  calendar.setYear(date.get(Calendar.YEAR));
  calendar.setMonth(date.get(Calendar.MONTH));
  calendar.setDay(date.get(Calendar.DAY_OF_MONTH));
  if (notifyListeners) {
    setSelection(new DateSelection(date, false));
    notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
  }
}

代码示例来源:origin: org.xworker/xworker_swt

GregorianCalendar c = new GregorianCalendar();
c.setTime(dv);
d.setYear(c.get(Calendar.YEAR));
d.setMonth(c.get(Calendar.MONTH));
d.setDay(c.get(Calendar.DAY_OF_MONTH));

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

setYear( 9996 );
setMonth( 0 );
setDay( 1 );
setYear( year );
setMonth( month );
setDay( day );

代码示例来源:origin: org.xworker/xworker_swt

GregorianCalendar c = new GregorianCalendar();
c.setTime(dateValue);
dt.setYear(c.get(Calendar.YEAR));
dt.setMonth(c.get(Calendar.MONTH));
dt.setDay(c.get(Calendar.DAY_OF_MONTH));

代码示例来源:origin: atdl4j/atdl4j

public void setValue(Comparable<DateTime> value)
{
  // 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 )
  {
    logger.debug( "setValue() parameter: " + parameter + " value: " + value );
    // -- no need to adjust DateTime --
  }
  
  // -- Force control to display time portion in local
  DateTime tempLocalTzDateTime = ((DateTime)value).withZone( DateTimeZone.getDefault() );
  
  if ( showMonthYear )
  {
    dateClock.setMonth( tempLocalTzDateTime.getMonthOfYear() - 1 );
    dateClock.setYear( tempLocalTzDateTime.getYear() );
  }
  if ( showDay )
  {
    dateClock.setDay( tempLocalTzDateTime.getDayOfMonth() );
  }
  if ( showTime )
  {
    timeClock.setHours( tempLocalTzDateTime.getHourOfDay() );
    timeClock.setMinutes( tempLocalTzDateTime.getMinuteOfHour() );
    timeClock.setSeconds( tempLocalTzDateTime.getSecondOfMinute() );
  }
}

代码示例来源:origin: org.xworker/xworker_swt

GregorianCalendar c = new GregorianCalendar();
c.setTime(dateValue);
dt.setYear(c.get(Calendar.YEAR));
dt.setMonth(c.get(Calendar.MONTH));
dt.setDay(c.get(Calendar.DAY_OF_MONTH));

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

argumentsDate.setYear(calendar.get(Calendar.YEAR));

相关文章

DateTime类方法