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

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

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

DateTime.isValidDate介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

if (!isValidDate (year, month, day)) return;
if (isCalendar ()) {
  this.year = year;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

if (!isValidDate (year, month, day)) return;
if (isCalendar ()) {
  this.year = year;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

if (!isValidDate (year, month, day)) return;
if (isCalendar ()) {
  this.year = year;

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * Sets the receiver's date, or day of the month, to the specified day.
 * <p>
 * The first day of the month is 1, and the last day depends on the month and year.
 * If the specified day is not valid for the receiver's month and year, then it is ignored.
 * </p>
 *
 * @param day a positive integer beginning with 1
 *
 * @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>
 *
 * @see #setDate
 */
public void setDay (int day) {
  checkWidget ();
  if (!isValidDate (getYear (), getMonth (), day)) return;
  if (isCalendar ()) {
    this.day = day;
    OS.gtk_calendar_select_day (calendarHandle, day);
  } else {
    calendar.set (Calendar.DAY_OF_MONTH, day);
    updateControl ();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Sets the receiver's date, or day of the month, to the specified day.
 * <p>
 * The first day of the month is 1, and the last day depends on the month and year.
 * If the specified day is not valid for the receiver's month and year, then it is ignored.
 * </p>
 *
 * @param day a positive integer beginning with 1
 *
 * @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>
 *
 * @see #setDate
 */
public void setDay (int day) {
  checkWidget ();
  if (!isValidDate (getYear (), getMonth (), day)) return;
  if (isCalendar ()) {
    this.day = day;
    OS.gtk_calendar_select_day (calendarHandle, day);
  } else {
    calendar.set (Calendar.DAY_OF_MONTH, day);
    updateControl ();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Sets the receiver's month.
 * <p>
 * The first month of the year is 0, and the last month is 11.
 * If the specified month is not valid for the receiver's day and year, then it is ignored.
 * </p>
 *
 * @param month an integer between 0 and 11
 *
 * @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>
 *
 * @see #setDate
 */
public void setMonth (int month) {
  checkWidget ();
  if (!isValidDate (getYear (), month, getDay ())) return;
  if (isCalendar ()) {
    this.month = month;
    OS.gtk_calendar_select_month (calendarHandle, month, year);
  } else {
    calendar.set (Calendar.MONTH, month);
    updateControl ();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Sets the receiver's date, or day of the month, to the specified day.
 * <p>
 * The first day of the month is 1, and the last day depends on the month and year.
 * If the specified day is not valid for the receiver's month and year, then it is ignored.
 * </p>
 *
 * @param day a positive integer beginning with 1
 *
 * @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>
 *
 * @see #setDate
 */
public void setDay (int day) {
  checkWidget ();
  if (!isValidDate (getYear (), getMonth (), day)) return;
  if (isCalendar ()) {
    this.day = day;
    OS.gtk_calendar_select_day (calendarHandle, day);
  } else {
    calendar.set (Calendar.DAY_OF_MONTH, day);
    updateControl ();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Sets the receiver's year.
 * <p>
 * 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.
 * </p>
 *
 * @param year an integer between 1752 and 9999
 *
 * @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>
 *
 * @see #setDate
 */
public void setYear (int year) {
  checkWidget ();
  if (!isValidDate (year, getMonth (), getDay ())) return;
  if (isCalendar ()) {
    this.year = year;
    OS.gtk_calendar_select_month (calendarHandle, month, year);
  } else {
    calendar.set (Calendar.YEAR, year);
    updateControl ();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * Sets the receiver's year.
 * <p>
 * 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.
 * </p>
 *
 * @param year an integer between 1752 and 9999
 *
 * @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>
 *
 * @see #setDate
 */
public void setYear (int year) {
  checkWidget ();
  if (!isValidDate (year, getMonth (), getDay ())) return;
  if (isCalendar ()) {
    this.year = year;
    OS.gtk_calendar_select_month (calendarHandle, month, year);
  } else {
    calendar.set (Calendar.YEAR, year);
    updateControl ();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Sets the receiver's month.
 * <p>
 * The first month of the year is 0, and the last month is 11.
 * If the specified month is not valid for the receiver's day and year, then it is ignored.
 * </p>
 *
 * @param month an integer between 0 and 11
 *
 * @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>
 *
 * @see #setDate
 */
public void setMonth (int month) {
  checkWidget ();
  if (!isValidDate (getYear (), month, getDay ())) return;
  if (isCalendar ()) {
    this.month = month;
    OS.gtk_calendar_select_month (calendarHandle, month, year);
  } else {
    calendar.set (Calendar.MONTH, month);
    updateControl ();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

/**
 * Sets the receiver's month.
 * <p>
 * The first month of the year is 0, and the last month is 11.
 * If the specified month is not valid for the receiver's day and year, then it is ignored.
 * </p>
 *
 * @param month an integer between 0 and 11
 *
 * @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>
 *
 * @see #setDate
 */
public void setMonth (int month) {
  checkWidget ();
  if (!isValidDate (getYear (), month, getDay ())) return;
  if (isCalendar ()) {
    this.month = month;
    OS.gtk_calendar_select_month (calendarHandle, month, year);
  } else {
    calendar.set (Calendar.MONTH, month);
    updateControl ();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

/**
 * Sets the receiver's year.
 * <p>
 * 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.
 * </p>
 *
 * @param year an integer between 1752 and 9999
 *
 * @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>
 *
 * @see #setDate
 */
public void setYear (int year) {
  checkWidget ();
  if (!isValidDate (year, getMonth (), getDay ())) return;
  if (isCalendar ()) {
    this.year = year;
    OS.gtk_calendar_select_month (calendarHandle, month, year);
  } else {
    calendar.set (Calendar.YEAR, year);
    updateControl ();
  }
}

相关文章

DateTime类方法