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

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

本文整理了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

  1. private void setPreloadedItems( Object value ) {
  2. if( value == null ) {
  3. preloadedItems = 0;
  4. } else {
  5. if( !( value instanceof Integer ) ) {
  6. error( SWT.ERROR_INVALID_ARGUMENT );
  7. }
  8. preloadedItems = ( ( Integer )value ).intValue();
  9. if( preloadedItems < 0 ) {
  10. error( SWT.ERROR_INVALID_RANGE );
  11. }
  12. }
  13. }

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

  1. private void setCustomItemHeight( Object value ) {
  2. if( value == null ) {
  3. customItemHeight = -1;
  4. } else {
  5. if( !( value instanceof Integer ) ) {
  6. error( SWT.ERROR_INVALID_ARGUMENT );
  7. }
  8. int itemHeight = ( ( Integer )value ).intValue();
  9. if( itemHeight < 0 ) {
  10. error( SWT.ERROR_INVALID_RANGE );
  11. }
  12. customItemHeight = itemHeight;
  13. }
  14. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. /**
  2. * Returns the item at the given, zero-relative index in the
  3. * receiver. Throws an exception if the index is out of range.
  4. *
  5. * @param index the index of the item to return
  6. * @return the item at the given index
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
  10. * </ul>
  11. * @exception SWTException <ul>
  12. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  13. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  14. * </ul>
  15. */
  16. public TableItem getItem (int index) {
  17. checkWidget ();
  18. if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
  19. return _getItem (index);
  20. }

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

  1. /**
  2. * Returns the item at the given, zero-relative index in the
  3. * receiver. Throws an exception if the index is out of range.
  4. *
  5. * @param index the index of the item to return
  6. * @return the item at the given index
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
  10. * </ul>
  11. * @exception SWTException <ul>
  12. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  13. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  14. * </ul>
  15. */
  16. public TableItem getItem (int index) {
  17. checkWidget();
  18. if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
  19. return _getItem (index);
  20. }

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

  1. /**
  2. * Returns the item at the given, zero-relative index in the
  3. * receiver. Throws an exception if the index is out of range.
  4. *
  5. * @param index the index of the item to return
  6. * @return the item at the given index
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
  10. * </ul>
  11. * @exception SWTException <ul>
  12. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  13. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  14. * </ul>
  15. */
  16. public TableItem getItem (int index) {
  17. checkWidget();
  18. if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
  19. return _getItem (index);
  20. }

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

  1. /**
  2. * Returns the item at the given, zero-relative index in the
  3. * receiver. Throws an exception if the index is out of range.
  4. *
  5. * @param index the index of the item to return
  6. * @return the item at the given index
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
  10. * </ul>
  11. * @exception SWTException <ul>
  12. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  13. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  14. * </ul>
  15. */
  16. public TableItem getItem (int index) {
  17. checkWidget();
  18. if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE);
  19. return _getItem (index);
  20. }

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

  1. /**
  2. * Sets the height of the area which would be used to
  3. * display <em>one</em> of the items in the table.
  4. *
  5. * @param itemHeight the height of one item
  6. *
  7. * @exception SWTException <ul>
  8. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  9. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  10. * </ul>
  11. *
  12. * @since 3.2
  13. */
  14. /*public*/ void setItemHeight (int itemHeight) {
  15. checkWidget ();
  16. if (itemHeight < -1) error (SWT.ERROR_INVALID_ARGUMENT);
  17. this.itemHeight = itemHeight;
  18. setItemHeight (true);
  19. setScrollWidth (null, true);
  20. }

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

  1. /**
  2. * Returns the item at the given, zero-relative index in the
  3. * receiver. Throws an exception if the index is out of range.
  4. *
  5. * @param index the index of the item to return
  6. * @return the item at the given index
  7. *
  8. * @exception IllegalArgumentException <ul>
  9. * <li>ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)</li>
  10. * </ul>
  11. * @exception SWTException <ul>
  12. * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
  13. * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  14. * </ul>
  15. */
  16. public TableItem getItem (int index) {
  17. checkWidget ();
  18. int count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
  19. if (!(0 <= index && index < count)) error (SWT.ERROR_INVALID_RANGE);
  20. return _getItem (index);
  21. }

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

  1. void destroyItem (TableItem item) {
  2. int count = (int)/*64*/OS.SendMessage (handle, OS.LVM_GETITEMCOUNT, 0, 0);
  3. int index = 0;
  4. while (index < count) {
  5. if (_getItem (index, false) == item) break;
  6. index++;
  7. }
  8. if (index == count) return;
  9. setDeferResize (true);
  10. ignoreSelect = ignoreShrink = true;
  11. int /*long*/ code = OS.SendMessage (handle, OS.LVM_DELETEITEM, index, 0);
  12. ignoreSelect = ignoreShrink = false;
  13. if (code == 0) error (SWT.ERROR_ITEM_NOT_REMOVED);
  14. _removeItem (index, count);
  15. --count;
  16. if (count == 0) setTableEmpty ();
  17. setDeferResize (false);
  18. }

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

  1. TableItem getItemInPixels (Point point) {
  2. checkWidget();
  3. if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
  4. int /*long*/ [] path = new int /*long*/ [1];
  5. OS.gtk_widget_realize (handle);
  6. int y = point.y;
  7. if (getHeaderVisible() && OS.GTK_VERSION > OS.VERSION(3, 9, 0)) {
  8. y -= getHeaderHeightInPixels();
  9. }
  10. if (!OS.gtk_tree_view_get_path_at_pos (handle, point.x, y, path, null, null, null)) return null;
  11. if (path [0] == 0) return null;
  12. int /*long*/ indices = OS.gtk_tree_path_get_indices (path [0]);
  13. TableItem item = null;
  14. if (indices != 0) {
  15. int [] index = new int [1];
  16. OS.memmove (index, indices, 4);
  17. item = _getItem (index [0]);
  18. }
  19. OS.gtk_tree_path_free (path [0]);
  20. return item;
  21. }

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

  1. void recreateRenderers () {
  2. if (checkRenderer != 0) {
  3. display.removeWidget (checkRenderer);
  4. OS.g_object_unref (checkRenderer);
  5. checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
  6. if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
  7. OS.g_object_ref (checkRenderer);
  8. display.addWidget (checkRenderer, this);
  9. OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
  10. }
  11. if (columnCount == 0) {
  12. createRenderers (OS.gtk_tree_view_get_column (handle, 0), Table.FIRST_COLUMN, true, 0);
  13. } else {
  14. for (int i = 0; i < columnCount; i++) {
  15. TableColumn column = columns [i];
  16. createRenderers (column.handle, column.modelIndex, i == 0, column.style);
  17. }
  18. }
  19. }

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

  1. void recreateRenderers () {
  2. if (checkRenderer != 0) {
  3. display.removeWidget (checkRenderer);
  4. OS.g_object_unref (checkRenderer);
  5. checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
  6. if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
  7. OS.g_object_ref (checkRenderer);
  8. display.addWidget (checkRenderer, this);
  9. OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
  10. }
  11. if (columnCount == 0) {
  12. createRenderers (OS.gtk_tree_view_get_column (handle, 0), Table.FIRST_COLUMN, true, 0);
  13. } else {
  14. for (int i = 0; i < columnCount; i++) {
  15. TableColumn column = columns [i];
  16. createRenderers (column.handle, column.modelIndex, i == 0, column.style);
  17. }
  18. }
  19. }

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

  1. void recreateRenderers () {
  2. if (checkRenderer != 0) {
  3. display.removeWidget (checkRenderer);
  4. OS.g_object_unref (checkRenderer);
  5. checkRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_toggle_get_type(), 0) : OS.gtk_cell_renderer_toggle_new ();
  6. if (checkRenderer == 0) error (SWT.ERROR_NO_HANDLES);
  7. OS.g_object_ref (checkRenderer);
  8. display.addWidget (checkRenderer, this);
  9. OS.g_signal_connect_closure (checkRenderer, OS.toggled, display.getClosure (TOGGLED), false);
  10. }
  11. if (columnCount == 0) {
  12. createRenderers (OS.gtk_tree_view_get_column (handle, 0), Table.FIRST_COLUMN, true, 0);
  13. } else {
  14. for (int i = 0; i < columnCount; i++) {
  15. TableColumn column = columns [i];
  16. createRenderers (column.handle, column.modelIndex, i == 0, column.style);
  17. }
  18. }
  19. }

相关文章

Table类方法