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

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

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

ToolBar.checkWidget介绍

暂无

代码示例

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

/**
 * Returns the number of items contained in the receiver.
 *
 * @return the number of items
 *
 * @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 getItemCount () {
  checkWidget();
  return itemCount;
}

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

/**
 * Returns the number of rows in the receiver. When
 * the receiver has the <code>WRAP</code> style, the
 * number of rows can be greater than one.  Otherwise,
 * the number of rows is always one.
 *
 * @return the number of items
 *
 * @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 getRowCount() {
 checkWidget();
 // return 1 as long as we don't support the WRAP style bit
 return 1;
}

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

/**
 * Returns the number of items contained in the receiver.
 *
 * @return the number of items
 *
 * @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 getItemCount() {
 checkWidget();
 return itemHolder.size();
}

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

/**
 * Returns the number of items contained in the receiver.
 *
 * @return the number of items
 *
 * @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 getItemCount () {
  checkWidget ();
  return (int)/*64*/OS.SendMessage (handle, OS.TB_BUTTONCOUNT, 0, 0);
}

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

public Point computeSize (int wHint, int hHint, boolean changed) {
  checkWidget();
  int width = wHint, height = hHint;
  if (wHint == SWT.DEFAULT) width = 0x7FFFFFFF;
  if (hHint == SWT.DEFAULT) height = 0x7FFFFFFF;
  int [] result = layout (width, height, false);
  Point extent = new Point (result [1], result [2]);
  if (wHint != SWT.DEFAULT) extent.x = wHint;
  if (hHint != SWT.DEFAULT) extent.y = hHint;
  Rectangle trim = computeTrim (0, 0, extent.x, extent.y);
  return new Point (trim.width, trim.height);
}

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

public void setRedraw (boolean redraw) {
  checkWidget();
  super.setRedraw (redraw);
  if (redraw && drawCount == 0) relayout();
}

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

@Override
public void setRedraw (boolean redraw) {
  checkWidget ();
  setDropDownItems (false);
  super.setRedraw (redraw);
  setDropDownItems (true);
}

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

@Override
Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
  checkWidget ();
  if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;
  if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0;
  /*
   * Feature in GTK. Size of toolbar is calculated incorrectly
   * and appears as just the overflow arrow, if the arrow is enabled
   * to display. The fix is to disable it before the computation of
   * size and enable it if WRAP style is set.
   */
  OS.gtk_toolbar_set_show_arrow (handle, false);
  Point size = computeNativeSize (handle, wHint, hHint, changed);
  if ((style & SWT.WRAP) != 0) OS.gtk_toolbar_set_show_arrow (handle, true);
  return size;
}

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

@Override
Point computeSizeInPixels (int wHint, int hHint, boolean changed) {
  checkWidget ();
  if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0;
  if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0;
  /*
   * Feature in GTK. Size of toolbar is calculated incorrectly
   * and appears as just the overflow arrow, if the arrow is enabled
   * to display. The fix is to disable it before the computation of
   * size and enable it if WRAP style is set.
   */
  OS.gtk_toolbar_set_show_arrow (handle, false);
  Point size = computeNativeSize (handle, wHint, hHint, changed);
  if ((style & SWT.WRAP) != 0) OS.gtk_toolbar_set_show_arrow (handle, true);
  return size;
}

代码示例来源: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.platform/org.eclipse.swt.gtk.linux.s390x

/**
 * Returns the number of items contained in the receiver.
 *
 * @return the number of items
 *
 * @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 getItemCount () {
  checkWidget();
  long /*int*/ list = OS.gtk_container_get_children (handle);
  if (list == 0) return 0;
  int itemCount = OS.g_list_length (list);
  OS.g_list_free (list);
  return itemCount;
}

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

/**
 * Returns the number of items contained in the receiver.
 *
 * @return the number of items
 *
 * @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 getItemCount () {
  checkWidget();
  int /*long*/ list = OS.gtk_container_get_children (handle);
  if (list == 0) return 0;
  int itemCount = OS.g_list_length (list);
  OS.g_list_free (list);
  return itemCount;
}

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

@Override
public void setToolTipText (String string) {
  checkWidget();
  super.setToolTipText (string);
  Shell shell = _getShell ();
  ToolItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    String newString = string != null ? null : items [i].toolTipText;
    shell.setToolTipText (items [i].handle, newString);
  }
}

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

@Override
public void setToolTipText (String string) {
  checkWidget();
  super.setToolTipText (string);
  Shell shell = _getShell ();
  ToolItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    String newString = string != null ? null : items [i].toolTipText;
    shell.setToolTipText (items [i].handle, newString);
  }
}

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

public Rectangle getBounds () {
  checkWidget();

  if (nsToolbar != null) {
    // The NSToolbar's view will always be a child of the Shell, so we can just
    // convert the frame to window-relative coordinates.
    NSRect rect = view.frame();
    rect = view.convertRect_toView_(rect, null);
    return new Rectangle((int)rect.x, (int)rect.y, (int)rect.width, (int)rect.height);
  }
  
  return super.getBounds();
}

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

@Override
public void setToolTipText (String string) {
  checkWidget();
  super.setToolTipText (string);
  Shell shell = _getShell ();
  ToolItem [] items = getItems ();
  for (int i = 0; i < items.length; i++) {
    String newString = string != null ? null : items [i].toolTipText;
    shell.setToolTipText (items [i].handle, newString);
  }
}

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

@Override
public boolean setParent (Composite parent) {
  checkWidget ();
  if (!super.setParent (parent)) return false;
  int /*long*/ hwndParent = parent.handle;
  OS.SendMessage (handle, OS.TB_SETPARENT, hwndParent, 0);
  /*
  * Bug in Windows.  When a tool bar is reparented, the tooltip
  * control that is automatically created for the item is not
  * reparented to the new shell.  The fix is to move the tooltip
  * over using SetWindowLongPtr().  Note that for some reason,
  * SetParent() does not work.
  */
  int /*long*/ hwndShell = parent.getShell ().handle;
  int /*long*/ hwndToolTip = OS.SendMessage (handle, OS.TB_GETTOOLTIPS, 0, 0);
  OS.SetWindowLongPtr (hwndToolTip, OS.GWLP_HWNDPARENT, hwndShell);
  return true;
}

相关文章

ToolBar类方法