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

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

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

Tree.clearAll介绍

[英]Clears all the items in the receiver. The text, icon and other attributes of the items are set to their default values. If the tree was created with the SWT.VIRTUAL style, these attributes are requested again as needed.
[中]清除接收器中的所有项目。项目的文本、图标和其他属性设置为默认值。如果树是用SWT.VIRTUAL样式创建的,则会根据需要再次请求这些属性。

代码示例

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

/**
 * Clears all the items in the receiver. The text, icon and other
 * attributes of the items are set to their default values. If the
 * tree was created with the <code>SWT.VIRTUAL</code> style, these
 * attributes are requested again as needed.
 *
 * @param all <code>true</code> if all child items should be cleared
 * recursively, and <code>false</code> otherwise
 *
 * @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>
 *
 * @see SWT#VIRTUAL
 * @see SWT#SetData
 *
 * @since 3.2
 */
public void clearAll (boolean all) {
  checkWidget ();
  parent.clearAll (all, handle);
}

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

/**
 * Clears all the items in the receiver. The text, icon and other
 * attributes of the items are set to their default values. If the
 * tree was created with the <code>SWT.VIRTUAL</code> style, these
 * attributes are requested again as needed.
 *
 * @param all <code>true</code> if all child items should be cleared
 * recursively, and <code>false</code> otherwise
 *
 * @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>
 *
 * @see SWT#VIRTUAL
 * @see SWT#SetData
 *
 * @since 3.2
 */
public void clearAll (boolean all) {
  checkWidget ();
  parent.clearAll (all, handle);
}

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

/**
 * Clears all the items in the receiver. The text, icon and other
 * attributes of the items are set to their default values. If the
 * tree was created with the <code>SWT.VIRTUAL</code> style, these
 * attributes are requested again as needed.
 * 
 * @param all <code>true</code> if all child items should be cleared
 * recursively, and <code>false</code> otherwise
 *
 * @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>
 * 
 * @see SWT#VIRTUAL
 * @see SWT#SetData
 * 
 * @since 3.2
 */
public void clearAll (boolean all) {
  checkWidget ();
  clearAll (null, all);
}

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

/**
 * Clears all the items in the receiver. The text, icon and other
 * attributes of the items are set to their default values. If the
 * tree was created with the <code>SWT.VIRTUAL</code> style, these
 * attributes are requested again as needed.
 *
 * @param all <code>true</code> if all child items should be cleared
 * recursively, and <code>false</code> otherwise
 *
 * @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>
 *
 * @see SWT#VIRTUAL
 * @see SWT#SetData
 *
 * @since 3.2
 */
public void clearAll (boolean all) {
  checkWidget ();
  clearAll (all, 0);
}
void clearAll (boolean all, int /*long*/ parentIter) {

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

/**
 * Clears all the items in the receiver. The text, icon and other
 * attributes of the items are set to their default values. If the
 * tree was created with the <code>SWT.VIRTUAL</code> style, these
 * attributes are requested again as needed.
 *
 * @param all <code>true</code> if all child items should be cleared
 * recursively, and <code>false</code> otherwise
 *
 * @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>
 *
 * @see SWT#VIRTUAL
 * @see SWT#SetData
 *
 * @since 3.2
 */
public void clearAll (boolean all) {
  checkWidget ();
  clearAll (all, 0);
}
void clearAll (boolean all, int /*long*/ parentIter) {

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

/**
 * Clears all the items in the receiver. The text, icon and other
 * attributes of the items are set to their default values. If the
 * tree was created with the <code>SWT.VIRTUAL</code> style, these
 * attributes are requested again as needed.
 *
 * @param all <code>true</code> if all child items should be cleared
 * recursively, and <code>false</code> otherwise
 *
 * @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>
 *
 * @see SWT#VIRTUAL
 * @see SWT#SetData
 *
 * @since 3.2
 */
public void clearAll (boolean all) {
  checkWidget ();
  parent.clearAll (all, handle);
}

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

/**
 * Clears all the items in the receiver. The text, icon and other
 * attributes of the items are set to their default values. If the
 * tree was created with the <code>SWT.VIRTUAL</code> style, these
 * attributes are requested again as needed.
 *
 * @param all <code>true</code> if all child items should be cleared
 * recursively, and <code>false</code> otherwise
 *
 * @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>
 *
 * @see SWT#VIRTUAL
 * @see SWT#SetData
 *
 * @since 3.2
 */
public void clearAll (boolean all) {
  checkWidget ();
  clearAll (all, 0);
}
void clearAll (boolean all, long /*int*/ parentIter) {

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

/**
 * Clears all the items in the receiver. The text, icon and other
 * attributes of the items are set to their default values. If the
 * tree was created with the <code>SWT.VIRTUAL</code> style, these
 * attributes are requested again as needed.
 * 
 * @param all <code>true</code> if all child items should be cleared
 * recursively, and <code>false</code> otherwise
 *
 * @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>
 * 
 * @see SWT#VIRTUAL
 * @see SWT#SetData
 * 
 * @since 3.2
 */
public void clearAll (boolean all) {
  checkWidget ();
  parent.clearAll (this, all);
}

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

void clear (TreeItem parentItem, int index, boolean all) {
  TreeItem item = _getItem (parentItem, index, false);
  if (item != null) {
    item.clear();
    item.redraw (-1);
    if (all) {
      clearAll (item, true);
    }
  }
}

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

void clearAll (int /*long*/ hItem, TVITEM tvItem, boolean all) {
  while (hItem != 0) {
    clear (hItem, tvItem);
    if (all) {
      int /*long*/ hFirstItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CHILD, hItem);
      clearAll (hFirstItem, tvItem, all);
    }
    hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_NEXT, hItem);
  }
}

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

void clearAll (TreeItem parentItem, boolean all) {
  int count = getItemCount (parentItem);
  if (count == 0) return;
  TreeItem [] children = parentItem == null ? items : parentItem.items; 
  for (int i=0; i<count; i++) {
    TreeItem item = children [i];
    if (item != null) {
      item.clear ();
      item.redraw (-1);
      if (all) clearAll (item, true);
    }
  }
}

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

void clear (int /*long*/ parentIter, int index, boolean all) {
  int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
  OS.gtk_tree_model_iter_nth_child(modelHandle, iter, parentIter, index);
  int[] value = new int[1];
  OS.gtk_tree_model_get (modelHandle, iter, ID_COLUMN, value, -1);
  if (value [0] != -1) {
    TreeItem item = items [value [0]];
    item.clear ();
  }
  if (all) clearAll (all, iter);
  OS.g_free (iter);
}

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

void clear (int /*long*/ parentIter, int index, boolean all) {
  int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
  OS.gtk_tree_model_iter_nth_child(modelHandle, iter, parentIter, index);
  int[] value = new int[1];
  OS.gtk_tree_model_get (modelHandle, iter, ID_COLUMN, value, -1);
  if (value [0] != -1) {
    TreeItem item = items [value [0]];
    item.clear ();
  }
  if (all) clearAll (all, iter);
  OS.g_free (iter);
}

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

void clear (long /*int*/ parentIter, int index, boolean all) {
  long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
  OS.gtk_tree_model_iter_nth_child(modelHandle, iter, parentIter, index);
  int[] value = new int[1];
  OS.gtk_tree_model_get (modelHandle, iter, ID_COLUMN, value, -1);
  if (value [0] != -1) {
    TreeItem item = items [value [0]];
    item.clear ();
  }
  if (all) clearAll (all, iter);
  OS.g_free (iter);
}

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

protected void internalAdd(Widget widget, Object parentElement,
    Object[] childElements) {
  if (contentProviderIsLazy) {
    if (widget instanceof TreeItem) {
      TreeItem ti = (TreeItem) widget;
      int count = ti.getItemCount() + childElements.length;
      ti.setItemCount(count);
      ti.clearAll(false);
    } else {
      Tree t = (Tree) widget;
      t.setItemCount(t.getItemCount() + childElements.length);
      t.clearAll(false);
    }
    return;
  }
  super.internalAdd(widget, parentElement, childElements);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

@Override
protected void internalAdd(Widget widget, Object parentElement,
    Object[] childElements) {
  if (contentProviderIsLazy) {
    if (widget instanceof TreeItem) {
      TreeItem ti = (TreeItem) widget;
      int count = ti.getItemCount() + childElements.length;
      ti.setItemCount(count);
      ti.clearAll(false);
    } else {
      Tree t = (Tree) widget;
      t.setItemCount(t.getItemCount() + childElements.length);
      t.clearAll(false);
    }
    return;
  }
  super.internalAdd(widget, parentElement, childElements);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

@Override
protected void internalAdd(Widget widget, Object parentElement,
    Object[] childElements) {
  if (contentProviderIsLazy) {
    if (widget instanceof TreeItem) {
      TreeItem ti = (TreeItem) widget;
      int count = ti.getItemCount() + childElements.length;
      ti.setItemCount(count);
      ti.clearAll(false);
    } else {
      Tree t = (Tree) widget;
      t.setItemCount(t.getItemCount() + childElements.length);
      t.clearAll(false);
    }
    return;
  }
  super.internalAdd(widget, parentElement, childElements);
}

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

void clearAll (boolean all, int /*long*/ parentIter) {
  int length = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
  if (length == 0) return;
  int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
  boolean valid = OS.gtk_tree_model_iter_children (modelHandle, iter, parentIter);
  int[] value = new int[1];
  while (valid) {
    OS.gtk_tree_model_get (modelHandle, iter, ID_COLUMN, value, -1);
    if (value [0] != -1) {
      TreeItem item = items [value [0]];
      item.clear ();
    }
    if (all) clearAll (all, iter);
    valid = OS.gtk_tree_model_iter_next (modelHandle, iter);
  }
  OS.g_free (iter);
}

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

void clearAll (boolean all, long /*int*/ parentIter) {
  int length = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
  if (length == 0) return;
  long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
  boolean valid = OS.gtk_tree_model_iter_children (modelHandle, iter, parentIter);
  int[] value = new int[1];
  while (valid) {
    OS.gtk_tree_model_get (modelHandle, iter, ID_COLUMN, value, -1);
    if (value [0] != -1) {
      TreeItem item = items [value [0]];
      item.clear ();
    }
    if (all) clearAll (all, iter);
    valid = OS.gtk_tree_model_iter_next (modelHandle, iter);
  }
  OS.g_free (iter);
}

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

void clearAll (boolean all, int /*long*/ parentIter) {
  int length = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
  if (length == 0) return;
  int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
  boolean valid = OS.gtk_tree_model_iter_children (modelHandle, iter, parentIter);
  int[] value = new int[1];
  while (valid) {
    OS.gtk_tree_model_get (modelHandle, iter, ID_COLUMN, value, -1);
    if (value [0] != -1) {
      TreeItem item = items [value [0]];
      item.clear ();
    }
    if (all) clearAll (all, iter);
    valid = OS.gtk_tree_model_iter_next (modelHandle, iter);
  }
  OS.g_free (iter);
}

相关文章

Tree类方法