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

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

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

ToolBar.error介绍

暂无

代码示例

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

/*public*/ void setTabItemList (ToolItem [] tabList) {
  checkWidget ();
  if (tabList != null) {
    for (int i=0; i<tabList.length; i++) {
      ToolItem item = tabList [i];
      if (item == null) error (SWT.ERROR_INVALID_ARGUMENT);
      if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
      if (item.parent != this) error (SWT.ERROR_INVALID_PARENT);
    }
    ToolItem [] newList = new ToolItem [tabList.length];
    System.arraycopy (tabList, 0, newList, 0, tabList.length);
    tabList = newList;
  }
  this.tabItemList = tabList;
}

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

/*public*/ void setTabItemList (ToolItem [] tabList) {
  checkWidget ();
  if (tabList != null) {
    for (int i=0; i<tabList.length; i++) {
      ToolItem item = tabList [i];
      if (item == null) error (SWT.ERROR_INVALID_ARGUMENT);
      if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
      if (item.parent != this) error (SWT.ERROR_INVALID_PARENT);
    }
    ToolItem [] newList = new ToolItem [tabList.length];
    System.arraycopy (tabList, 0, newList, 0, tabList.length);
    tabList = newList;
  }
  this.tabItemList = tabList;
}

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

/*public*/ void setTabItemList (ToolItem [] tabList) {
  checkWidget ();
  if (tabList != null) {
    for (int i=0; i<tabList.length; i++) {
      ToolItem item = tabList [i];
      if (item == null) error (SWT.ERROR_INVALID_ARGUMENT);
      if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
      if (item.parent != this) error (SWT.ERROR_INVALID_PARENT);
    }
    ToolItem [] newList = new ToolItem [tabList.length];
    System.arraycopy (tabList, 0, newList, 0, tabList.length);
    tabList = newList;
  }
  this.tabItemList = tabList;
}

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

/*public*/ void setTabItemList (ToolItem [] tabList) {
  checkWidget ();
  if (tabList != null) {
    for (int i=0; i<tabList.length; i++) {
      ToolItem item = tabList [i];
      if (item == null) error (SWT.ERROR_INVALID_ARGUMENT);
      if (item.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);
      if (item.parent != this) error (SWT.ERROR_INVALID_PARENT);
    }
    ToolItem [] newList = new ToolItem [tabList.length];
    System.arraycopy (tabList, 0, newList, 0, tabList.length);
    tabList = newList;
  }
  this.tabItemList = tabList;
}

代码示例来源: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.linux.s390x

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

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

@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.platform/org.eclipse.swt.gtk.aix.ppc

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

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

/**
 * Searches the receiver's list starting at the first item
 * (index 0) until an item is found that is equal to the
 * argument, and returns the index of that item. If no item
 * is found, returns -1.
 *
 * @param item the search item
 * @return the index of the item
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the tool item is null</li>
 *    <li>ERROR_INVALID_ARGUMENT - if the tool item has been disposed</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 int indexOf (ToolItem item) {
  checkWidget ();
  if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
  if (item.isDisposed()) error(SWT.ERROR_INVALID_ARGUMENT);
  return (int)/*64*/OS.SendMessage (handle, OS.TB_COMMANDTOINDEX, item.id, 0);
}

代码示例来源: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 ToolItem getItem (int index) {
  checkWidget ();
  int count = (int)/*64*/OS.SendMessage (handle, OS.TB_BUTTONCOUNT, 0, 0);
  if (!(0 <= index && index < count)) error (SWT.ERROR_INVALID_RANGE);
  TBBUTTON lpButton = new TBBUTTON ();
  int /*long*/ result = OS.SendMessage (handle, OS.TB_GETBUTTON, index, lpButton);
  if (result == 0) error (SWT.ERROR_CANNOT_GET_ITEM);
  return items [lpButton.idCommand];
}

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

/**
 * Searches the receiver's list starting at the first item
 * (index 0) until an item is found that is equal to the
 * argument, and returns the index of that item. If no item
 * is found, returns -1.
 *
 * @param item the search item
 * @return the index of the item
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the tool item is null</li>
 *    <li>ERROR_INVALID_ARGUMENT - if the tool item has been disposed</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 int indexOf (ToolItem item) {
  checkWidget();
  if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
  ToolItem [] items = getItems ();
  for (int i=0; i<items.length; i++) {
    if (item == items[i]) return i;
  }
  return -1;
}

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

ToolItem getItemInPixels (Point point) {
  if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
  ToolItem[] items = getItems();
  for (int i=0; i<items.length; i++) {
    if (items[i].getBoundsInPixels().contains(point)) return items[i];
  }
  return null;
}

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

ToolItem getItemInPixels (Point point) {
  if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
  ToolItem[] items = getItems();
  for (int i=0; i<items.length; i++) {
    if (items[i].getBoundsInPixels().contains(point)) return items[i];
  }
  return null;
}

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

ToolItem getItemInPixels (Point point) {
  if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
  ToolItem[] items = getItems();
  for (int i=0; i<items.length; i++) {
    if (items[i].getBoundsInPixels().contains(point)) return items[i];
  }
  return null;
}

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

void createItem (ToolItem item, int index) {
  if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE);
  if (itemCount == items.length) {
    ToolItem [] newItems = new ToolItem [itemCount + 4];
    System.arraycopy (items, 0, newItems, 0, items.length);
    items = newItems;
  }
  item.createWidget();
  System.arraycopy (items, index, items, index + 1, itemCount++ - index);
  items [index] = item;
  if (nsToolbar != null) {
    nsToolbar.insertItemWithItemIdentifier(item.getItemID(), index);        
  } else {
    view.addSubview(item.view);
  }
  relayout ();
}

代码示例来源: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 ToolItem getItem (int index) {
  checkWidget();
  if (!(0 <= index && index < getItemCount())) error (SWT.ERROR_INVALID_RANGE);
  return getItems()[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 ToolItem getItem (int index) {
  checkWidget();
  if (!(0 <= index && index < getItemCount())) error (SWT.ERROR_INVALID_RANGE);
  return getItems()[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 ToolItem getItem (int index) {
  checkWidget();
  if (!(0 <= index && index < getItemCount())) error (SWT.ERROR_INVALID_RANGE);
  return getItems()[index];
}

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

/**
 * Returns the item at the given point in the receiver
 * or null if no such item exists. The point is in the
 * coordinate system of the receiver.
 *
 * @param point the point used to locate the item
 * @return the item at the given point
 *
 * @exception IllegalArgumentException <ul>
 *    <li>ERROR_NULL_ARGUMENT - if the point is null</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 ToolItem getItem (Point point) {
  checkWidget();
  if (point == null) error (SWT.ERROR_NULL_ARGUMENT);
  for (int i=0; i<itemCount; i++) {
    Rectangle rect = items [i].getBounds ();
    if (rect.contains (point)) return items [i];
  }
  return null;
}

相关文章

ToolBar类方法