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

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

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

Tree.addDisposeListener介绍

暂无

代码示例

代码示例来源:origin: cbeust/testng-eclipse

private void addListeners() {
 m_tree.addSelectionListener(new SelectionListener() {
  public void widgetSelected(SelectionEvent e) {
   activate();
  }
  public void widgetDefaultSelected(SelectionEvent e) {
   activate();
  }
 });
 m_tree.addDisposeListener(new DisposeListener() {
  public void widgetDisposed(DisposeEvent e) {
   disposeIcons();
  }
 });
 m_tree.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseDoubleClick(MouseEvent e) {
   handleDoubleClick(e);
  }
 });
}

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

protected void hookControl(Control control) {
  super.hookControl(control);
  Tree treeControl = (Tree) control;
  if ((treeControl.getStyle() & SWT.VIRTUAL) != 0) {
    treeControl.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        treeIsDisposed = true;
        unmapAllElements();
      }
    });
    treeControl.addListener(SWT.SetData, new Listener() {
      public void handleEvent(Event event) {
        if (contentProviderIsLazy) {
          TreeItem item = (TreeItem) event.item;
          TreeItem parentItem = item.getParentItem();
          int index = event.index;
          virtualLazyUpdateWidget(
              parentItem == null ? (Widget) getTree()
                  : parentItem, index);
        }
      }
    });
  }
}

代码示例来源:origin: BiglySoftware/BiglyBT

private void createDragSource(final Tree tree) {
  Transfer[] types = new Transfer[] { TextTransfer.getInstance() };
int operations = DND.DROP_MOVE;
final DragSource source = new DragSource(tree, operations);
source.setTransfer(types);
source.addDragListener(new DragSourceListener() {
    @Override
    public void dragStart(DragSourceEvent event) {
      TreeItem[] selection = tree.getSelection();
  event.doit = selection.length > 0;
      tree.setData("dragging", 1);
 }
  @Override
 public void dragSetData(DragSourceEvent event) {
  event.data = "drag";
  event.detail = DND.DROP_MOVE;
 }
    @Override
    public void dragFinished(DragSourceEvent event) {
      tree.setData("dragging", null);
    }
});
tree.addDisposeListener(new DisposeListener() {
    @Override
    public void widgetDisposed(DisposeEvent e) {
      source.dispose();
    }
  });
}

代码示例来源:origin: BiglySoftware/BiglyBT

tree.addDisposeListener(new DisposeListener() {
    @Override
    public void widgetDisposed(DisposeEvent e) {

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

@Override
protected void hookControl(Control control) {
  super.hookControl(control);
  Tree treeControl = (Tree) control;
  if ((treeControl.getStyle() & SWT.VIRTUAL) != 0) {
    treeControl.addDisposeListener(e -> {
      treeIsDisposed = true;
      unmapAllElements();
    });
    treeControl.addListener(SWT.SetData, event -> {
      if (contentProviderIsLazy) {
        TreeItem item = (TreeItem) event.item;
        TreeItem parentItem = item.getParentItem();
        int index = event.index;
        virtualLazyUpdateWidget(
            parentItem == null ? (Widget) getTree()
                : parentItem, index);
      }
    });
  }
}

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

@Override
protected void hookControl(Control control) {
  super.hookControl(control);
  Tree treeControl = (Tree) control;
  if ((treeControl.getStyle() & SWT.VIRTUAL) != 0) {
    treeControl.addDisposeListener(e -> {
      treeIsDisposed = true;
      unmapAllElements();
    });
    treeControl.addListener(SWT.SetData, event -> {
      if (contentProviderIsLazy) {
        TreeItem item = (TreeItem) event.item;
        TreeItem parentItem = item.getParentItem();
        int index = event.index;
        virtualLazyUpdateWidget(
            parentItem == null ? (Widget) getTree()
                : parentItem, index);
      }
    });
  }
}

代码示例来源:origin: org.eclipse.egit/ui

return null;
final Menu menu = new Menu(filesViewer.getTree());
filesViewer.getTree().addDisposeListener(new DisposeListener() {

相关文章

Tree类方法