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

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

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

Tree.remove介绍

[英]Removes all of the items from the receiver.
[中]从接收器中删除所有项目。

代码示例

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

void setItemCount (long /*int*/ parentIter, int count) {
  int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
  if (count == itemCount) return;
  boolean isVirtual = (style & SWT.VIRTUAL) != 0;
  if (!isVirtual) setRedraw (false);
  remove (parentIter, count, itemCount - 1);
  if (isVirtual) {
    if (fixAccessibility ()) {
      ignoreAccessibility = true;
    }
    for (int i=itemCount; i<count; i++) {
      long /*int*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
      if (iter == 0) error (SWT.ERROR_NO_HANDLES);
      OS.gtk_tree_store_append (modelHandle, iter, parentIter);
      OS.gtk_tree_store_set (modelHandle, iter, ID_COLUMN, -1, -1);
      OS.g_free (iter);
    }
    if (fixAccessibility ()) {
      ignoreAccessibility = false;
      OS.g_object_notify (handle, OS.model);
    }
  } else {
    for (int i=itemCount; i<count; i++) {
      new TreeItem (this, parentIter, SWT.NONE, i, true);
    }
  }
  if (!isVirtual) setRedraw (true);
  modelChanged = true;
}

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

void setItemCount (int /*long*/ parentIter, int count) {
  int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
  if (count == itemCount) return;
  boolean isVirtual = (style & SWT.VIRTUAL) != 0;
  if (!isVirtual) setRedraw (false);
  remove (parentIter, count, itemCount - 1);
  if (isVirtual) {
    if (fixAccessibility ()) {
      ignoreAccessibility = true;
    }
    for (int i=itemCount; i<count; i++) {
      int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
      if (iter == 0) error (SWT.ERROR_NO_HANDLES);
      OS.gtk_tree_store_append (modelHandle, iter, parentIter);
      OS.gtk_tree_store_set (modelHandle, iter, ID_COLUMN, -1, -1);
      OS.g_free (iter);
    }
    if (fixAccessibility ()) {
      ignoreAccessibility = false;
      OS.g_object_notify (handle, OS.model);
    }
  } else {
    for (int i=itemCount; i<count; i++) {
      new TreeItem (this, parentIter, SWT.NONE, i, true);
    }
  }
  if (!isVirtual) setRedraw (true);
  modelChanged = true;
}

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

void setItemCount (int /*long*/ parentIter, int count) {
  int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, parentIter);
  if (count == itemCount) return;
  boolean isVirtual = (style & SWT.VIRTUAL) != 0;
  if (!isVirtual) setRedraw (false);
  remove (parentIter, count, itemCount - 1);
  if (isVirtual) {
    if (fixAccessibility ()) {
      ignoreAccessibility = true;
    }
    for (int i=itemCount; i<count; i++) {
      int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ());
      if (iter == 0) error (SWT.ERROR_NO_HANDLES);
      OS.gtk_tree_store_append (modelHandle, iter, parentIter);
      OS.gtk_tree_store_set (modelHandle, iter, ID_COLUMN, -1, -1);
      OS.g_free (iter);
    }
    if (fixAccessibility ()) {
      ignoreAccessibility = false;
      OS.g_object_notify (handle, OS.model);
    }
  } else {
    for (int i=itemCount; i<count; i++) {
      new TreeItem (this, parentIter, SWT.NONE, i, true);
    }
  }
  if (!isVirtual) setRedraw (true);
  modelChanged = true;
}

相关文章

Tree类方法