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

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

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

DateTime.checkWidget介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

public Control [] getChildren () {
  checkWidget();
  return new Control [0];
}

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

/**
 * Returns the minimum value which the receiver will allow or null if no minimum limit is applied.
 *
 * @return the minimum value
 * @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 3.2
 */
public Date getMinimum() {
 checkWidget();
 return minimum == null ? null : ( Date )minimum.clone();
}

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

void selectAll () {
  checkWidget ();
  if (textEntryHandle != 0)
    OS.gtk_editable_select_region (textEntryHandle, 0, -1);
}

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

void selectAll () {
  checkWidget ();
  if (textEntryHandle != 0)
    OS.gtk_editable_select_region (textEntryHandle, 0, -1);
}

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

void selectAll () {
  checkWidget ();
  if (textEntryHandle != 0)
    OS.gtk_editable_select_region (textEntryHandle, 0, -1);
}

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

String getText (int start, int end) {
  checkWidget ();
  if (!(start <= end && 0 <= end)) return "";
  String str = getText ();
  int length = str.length ();
  end = Math.min (end, length - 1);
  if (start > end) return "";
  start = Math.max (0, start);
  /*
  * NOTE: The current implementation uses substring ()
  * which can reference a potentially large character
  * array.
  */
  return str.substring (start, end + 1);
}

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

String getText (int start, int end) {
  checkWidget ();
  if (!(start <= end && 0 <= end)) return "";
  String str = getText ();
  int length = str.length ();
  end = Math.min (end, length - 1);
  if (start > end) return "";
  start = Math.max (0, start);
  /*
  * NOTE: The current implementation uses substring ()
  * which can reference a potentially large character
  * array.
  */
  return str.substring (start, end + 1);
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Returns the receiver's seconds.
 * <p>
 * Seconds is an integer between 0 and 59.
 * </p>
 *
 * @return 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 int getSeconds () {
  checkWidget ();
  return (int)/*64*/getCalendarDate().secondOfMinute();
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Returns the receiver's date, or day of the month.
 * <p>
 * The first day of the month is 1, and the last day depends on the month and year.
 * </p>
 *
 * @return 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>
 */
public int getDay () {
  checkWidget ();
  return (int)/*64*/getCalendarDate().dayOfMonth();
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Returns the receiver's hours.
 * <p>
 * Hours is an integer between 0 and 23.
 * </p>
 *
 * @return 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 int getHours () {
  checkWidget ();
  return (int)/*64*/getCalendarDate().hourOfDay();
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

/**
 * Returns the receiver's year.
 * <p>
 * The first year is 1752 and the last year is 9999.
 * </p>
 *
 * @return 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>
 */
public int getYear () {
  checkWidget ();
  return (int)/*64*/getCalendarDate().yearOfCommonEra();
}

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

/** returns selected text **/
Point getSelection () {
  checkWidget ();
  Point selection;
  int [] start = new int [1];
  int [] end = new int [1];
  OS.gtk_editable_get_selection_bounds (textEntryHandle, start, end);
  int /*long*/ ptr = OS.gtk_entry_get_text (textEntryHandle);
  start[0] = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, start[0]);
  end[0] = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, end[0]);
  selection = new Point (start [0], end [0]);
  return selection;

}

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

/** returns selected text **/
Point getSelection () {
  checkWidget ();
  Point selection;
  int [] start = new int [1];
  int [] end = new int [1];
  OS.gtk_editable_get_selection_bounds (textEntryHandle, start, end);
  long /*int*/ ptr = OS.gtk_entry_get_text (textEntryHandle);
  start[0] = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, start[0]);
  end[0] = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, end[0]);
  selection = new Point (start [0], end [0]);
  return selection;

}

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

/** returns selected text **/
Point getSelection () {
  checkWidget ();
  Point selection;
  int [] start = new int [1];
  int [] end = new int [1];
  OS.gtk_editable_get_selection_bounds (textEntryHandle, start, end);
  int /*long*/ ptr = OS.gtk_entry_get_text (textEntryHandle);
  start[0] = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, start[0]);
  end[0] = (int)/*64*/OS.g_utf8_offset_to_utf16_offset (ptr, end[0]);
  selection = new Point (start [0], end [0]);
  return selection;

}

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

void setSelection (int start, int end) {
  checkWidget ();
  long /*int*/ ptr = OS.gtk_entry_get_text (textEntryHandle);
  start = (int)/*64*/OS.g_utf16_offset_to_utf8_offset (ptr, start);
  end = (int)/*64*/OS.g_utf16_offset_to_utf8_offset (ptr, end);
  OS.gtk_editable_set_position (textEntryHandle, start);
  OS.gtk_editable_select_region (textEntryHandle, start, end);
}

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

void setSelection (int start, int end) {
  checkWidget ();
  int /*long*/ ptr = OS.gtk_entry_get_text (textEntryHandle);
  start = (int)/*64*/OS.g_utf16_offset_to_utf8_offset (ptr, start);
  end = (int)/*64*/OS.g_utf16_offset_to_utf8_offset (ptr, end);
  OS.gtk_editable_set_position (textEntryHandle, start);
  OS.gtk_editable_select_region (textEntryHandle, start, end);
}

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

void setSelection (int start, int end) {
  checkWidget ();
  int /*long*/ ptr = OS.gtk_entry_get_text (textEntryHandle);
  start = (int)/*64*/OS.g_utf16_offset_to_utf8_offset (ptr, start);
  end = (int)/*64*/OS.g_utf16_offset_to_utf8_offset (ptr, end);
  OS.gtk_editable_set_position (textEntryHandle, start);
  OS.gtk_editable_select_region (textEntryHandle, start, end);
}

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

void replaceCurrentlySelectedTextRegion (String string) {
  checkWidget ();
  if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
  byte [] buffer = Converter.wcsToMbcs (null, string, false);
  int [] start = new int [1], end = new int [1];
  OS.gtk_editable_get_selection_bounds (textEntryHandle, start, end);
  OS.gtk_editable_delete_selection (textEntryHandle);
  OS.gtk_editable_insert_text (textEntryHandle, buffer, buffer.length, start);
  OS.gtk_editable_set_position (textEntryHandle, start [0]);
}

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

void replaceCurrentlySelectedTextRegion (String string) {
  checkWidget ();
  if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
  byte [] buffer = Converter.wcsToMbcs (null, string, false);
  int [] start = new int [1], end = new int [1];
  OS.gtk_editable_get_selection_bounds (textEntryHandle, start, end);
  OS.gtk_editable_delete_selection (textEntryHandle);
  OS.gtk_editable_insert_text (textEntryHandle, buffer, buffer.length, start);
  OS.gtk_editable_set_position (textEntryHandle, start [0]);
}

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

void replaceCurrentlySelectedTextRegion (String string) {
  checkWidget ();
  if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
  byte [] buffer = Converter.wcsToMbcs (null, string, false);
  int [] start = new int [1], end = new int [1];
  OS.gtk_editable_get_selection_bounds (textEntryHandle, start, end);
  OS.gtk_editable_delete_selection (textEntryHandle);
  OS.gtk_editable_insert_text (textEntryHandle, buffer, buffer.length, start);
  OS.gtk_editable_set_position (textEntryHandle, start [0]);
}

相关文章

DateTime类方法