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

x33g5p2x  于2022-01-29 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(144)

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

Table.error介绍

暂无

代码示例

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

private void setPreloadedItems( Object value ) {
 if( value == null ) {
  preloadedItems = 0;
 } else {
  if( !( value instanceof Integer ) ) {
   error( SWT.ERROR_INVALID_ARGUMENT );
  }
  preloadedItems = ( ( Integer )value ).intValue();
  if( preloadedItems < 0 ) {
   error( SWT.ERROR_INVALID_RANGE );
  }
 }
}

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

private void setCustomItemHeight( Object value ) {
 if( value == null ) {
  customItemHeight = -1;
 } else {
  if( !( value instanceof Integer ) ) {
   error( SWT.ERROR_INVALID_ARGUMENT );
  }
  int itemHeight = ( ( Integer )value ).intValue();
  if( itemHeight < 0 ) {
   error( SWT.ERROR_INVALID_RANGE );
  }
  customItemHeight = itemHeight;
 }
}

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

@Override
protected void checkSubclass () {
  if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

@Override
protected void checkSubclass () {
  if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}

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

@Override
protected void checkSubclass () {
  if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}

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

@Override
protected void checkSubclass () {
  if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}

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

protected void checkSubclass () {
  if (!isValidSubclass ()) error (SWT.ERROR_INVALID_SUBCLASS);
}

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

/*public*/ void setItemHeight (int itemHeight) {
  checkWidget ();
  if (itemHeight < -1) error (SWT.ERROR_INVALID_ARGUMENT);
  if (itemHeight == -1) {
    //TODO - reset item height, ensure other API's such as setFont don't do this
  } else {
    ((NSTableView)view).setRowHeight (itemHeight);
  }
}

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

void createItem (TableItem item, int index) {
  if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
  if (itemCount == items.length) {
    /* Grow the array faster when redraw is off */
    int length = getDrawing () ? items.length + 4 : Math.max (4, items.length * 3 / 2);
    TableItem [] newItems = new TableItem [length];
    System.arraycopy (items, 0, newItems, 0, items.length);
    items = newItems;
  }
  System.arraycopy (items, index, items, index + 1, itemCount++ - index);
  items [index] = item;
  updateRowCount();
  if (index != itemCount) fixSelection (index, true);
}

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

/**
 * Returns the item at the given, zero-relative index in the
 * receiver. Throws an exception if the index is out of range.
 *
 * @param index the index of the item to return
 * @return the item at the given index
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
 * </ul>
 * @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 TableItem getItem (int index) {
  checkWidget ();
  if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
  return _getItem (index);
}

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

/**
 * Returns the item at the given, zero-relative index in the
 * receiver. Throws an exception if the index is out of range.
 *
 * @param index the index of the item to return
 * @return the item at the given index
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
 * </ul>
 * @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 TableItem getItem (int index) {
  checkWidget();
  if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
  return _getItem (index);
}

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

/**
 * Returns the item at the given, zero-relative index in the
 * receiver. Throws an exception if the index is out of range.
 *
 * @param index the index of the item to return
 * @return the item at the given index
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
 * </ul>
 * @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 TableItem getItem (int index) {
  checkWidget();
  if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
  return _getItem (index);
}

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

/**
 * Returns the item at the given, zero-relative index in the
 * receiver. Throws an exception if the index is out of range.
 *
 * @param index the index of the item to return
 * @return the item at the given index
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
 * </ul>
 * @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 TableItem getItem (int index) {
  checkWidget();
  if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
  return _getItem (index);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * Sets the height of the area which would be used to
 * display <em>one</em> of the items in the table.
 *
 * @param itemHeight the height of one item
 *
 * @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*/ void setItemHeight (int itemHeight) {
  checkWidget ();
  if (itemHeight < -1) error (SWT.ERROR_INVALID_ARGUMENT);
  this.itemHeight = itemHeight;
  setItemHeight (true);
  setScrollWidth (null, true);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

/**
 * Returns the item at the given, zero-relative index in the
 * receiver. Throws an exception if the index is out of range.
 *
 * @param index the index of the item to return
 * @return the item at the given index
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
 * </ul>
 * @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 TableItem getItem (int index) {
  checkWidget ();
  int count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
  if (!(0 <= index && index < count)) error (SWT.ERROR_INVALID_RANGE);
  return _getItem (index);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

void destroyItem (TableItem item) {
  int count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
  int index = 0;
  while (index < count) {
    if (_getItem (index, false) == item) break;
    index++;
  }
  if (index == count) return;
  setDeferResize (true);
  ignoreSelect = ignoreShrink = true;
  int /*long*/ code = OS.SendMessage (handle, OS.LVM_DELETEITEM, index, 0);
  ignoreSelect = ignoreShrink = false;
  if (code == 0) error (SWT.ERROR_ITEM_NOT_REMOVED);
  _removeItem (index, count);
  --count;
  if (count == 0) setTableEmpty ();
  setDeferResize (false);
}

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

TableItem getItemInPixels (Point point) {
  checkWidget();
  if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
  int /*long*/ [] path = new int /*long*/ [1];
  OS.gtk_widget_realize (handle);
  int y = point.y;
  if (getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
    y -= getHeaderHeightInPixels();
  }
  if (!OS.gtk_tree_view_get_path_at_pos (handle, point.x, y, path, null, null, null)) return null;
  if (path [0] == 0) return null;
  int /*long*/ indices = OS.gtk_tree_path_get_indices (path [0]);
  TableItem item = null;
  if (indices != 0) {
    int [] index = new int [1];
    OS.memmove (index, indices, 4);
    item = _getItem (index [0]);
  }
  OS.gtk_tree_path_free (path [0]);
  return item;
}

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

void recreateRenderers () {
  if (checkRenderer != 0) {
    display.removeWidget (checkRenderer);
    OS.g_object_unref (checkRenderer);
    checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
    if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
    OS.g_object_ref (checkRenderer);
    display.addWidget (checkRenderer, this);
    OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
  }
  if (columnCount == 0) {
    createRenderers (OS.gtk_tree_view_get_column (handle, 0), Table.FIRST_COLUMN, true, 0);
  } else {
    for (int i = 0; i < columnCount; i++) {
      TableColumn column = columns [i];
      createRenderers (column.handle, column.modelIndex, i == 0, column.style);
    }
  }
}

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

void recreateRenderers () {
  if (checkRenderer != 0) {
    display.removeWidget (checkRenderer);
    OS.g_object_unref (checkRenderer);
    checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
    if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
    OS.g_object_ref (checkRenderer);
    display.addWidget (checkRenderer, this);
    OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
  }
  if (columnCount == 0) {
    createRenderers (OS.gtk_tree_view_get_column (handle, 0), Table.FIRST_COLUMN, true, 0);
  } else {
    for (int i = 0; i < columnCount; i++) {
      TableColumn column = columns [i];
      createRenderers (column.handle, column.modelIndex, i == 0, column.style);
    }
  }
}

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

void recreateRenderers () {
  if (checkRenderer != 0) {
    display.removeWidget (checkRenderer);
    OS.g_object_unref (checkRenderer);
    checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
    if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
    OS.g_object_ref (checkRenderer);
    display.addWidget (checkRenderer, this);
    OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
  }
  if (columnCount == 0) {
    createRenderers (OS.gtk_tree_view_get_column (handle, 0), Table.FIRST_COLUMN, true, 0);
  } else {
    for (int i = 0; i < columnCount; i++) {
      TableColumn column = columns [i];
      createRenderers (column.handle, column.modelIndex, i == 0, column.style);
    }
  }
}

相关文章

Table类方法