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

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

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

Tree.removeListener介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.emf/org.eclipse.emf.converter

protected void treeDisposed()
{
 if (!tree.isDisposed())
 {
  tree.removeListener(SWT.Selection, this);
  tree.removeListener(SWT.Dispose, this);
 }
 tree = null;
}

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

/**
 * Removes the listener from the collection of listeners who will be notified
 * when the receiver's selection changes.
 *
 * @param listener the listener which should no longer be notified
 * @exception IllegalArgumentException <ul>
 *              <li>ERROR_NULL_ARGUMENT - if the listener 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>
 * @see SelectionListener
 * @see #addSelectionListener
 */
public void removeSelectionListener( SelectionListener listener ) {
 checkWidget();
 if( listener == null ) {
  SWT.error( SWT.ERROR_NULL_ARGUMENT );
 }
 removeListener( SWT.Selection, listener );
 removeListener( SWT.DefaultSelection, listener );
}

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

/**
 * Removes the listener from the collection of listeners who will be notified
 * when items in the receiver are expanded or collapsed.
 *
 * @param listener the listener which should no longer be notified
 * @exception IllegalArgumentException <ul>
 *              <li>ERROR_NULL_ARGUMENT - if the listener 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>
 * @see TreeListener
 * @see #addTreeListener
 */
public void removeTreeListener( TreeListener listener ) {
 checkWidget();
 if( listener == null ) {
  error( SWT.ERROR_NULL_ARGUMENT );
 }
 removeListener( SWT.Expand, listener );
 removeListener( SWT.Collapse, listener );
}

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

void onDispose(Event event) {
  removeListener(SWT.Dispose, listener);
  notifyListeners(SWT.Dispose, event);
  event.type = SWT.None;

  tree.removeListener(SWT.Collapse, treeListener);
  tree.removeListener(SWT.Expand, treeListener);
  tree.removeListener(SWT.FocusIn, treeListener);
  tree.removeListener(SWT.MouseDown, treeListener);
  unhookRowColumnListeners();
  ScrollBar hBar = tree.getHorizontalBar();
  if (hBar != null) {
    hBar.removeListener(SWT.Selection, resizeListener);
  }
  ScrollBar vBar = tree.getVerticalBar();
  if (vBar != null) {
    vBar.removeListener(SWT.Selection, resizeListener);
  }
}

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

void onDispose(Event event) {
  removeListener(SWT.Dispose, listener);
  notifyListeners(SWT.Dispose, event);
  event.type = SWT.None;

  tree.removeListener(SWT.Collapse, treeListener);
  tree.removeListener(SWT.Expand, treeListener);
  tree.removeListener(SWT.FocusIn, treeListener);
  tree.removeListener(SWT.MouseDown, treeListener);
  unhookRowColumnListeners();
  ScrollBar hBar = tree.getHorizontalBar();
  if (hBar != null) {
    hBar.removeListener(SWT.Selection, resizeListener);
  }
  ScrollBar vBar = tree.getVerticalBar();
  if (vBar != null) {
    vBar.removeListener(SWT.Selection, resizeListener);
  }
}

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

void onDispose(Event event) {
  removeListener(SWT.Dispose, listener);
  notifyListeners(SWT.Dispose, event);
  event.type = SWT.None;

  tree.removeListener(SWT.Collapse, treeListener);
  tree.removeListener(SWT.Expand, treeListener);
  tree.removeListener(SWT.FocusIn, treeListener);
  tree.removeListener(SWT.MouseDown, treeListener);
  unhookRowColumnListeners();
  ScrollBar hBar = tree.getHorizontalBar();
  if (hBar != null) {
    hBar.removeListener(SWT.Selection, resizeListener);
  }
  ScrollBar vBar = tree.getVerticalBar();
  if (vBar != null) {
    vBar.removeListener(SWT.Selection, resizeListener);
  }
}

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

void onDispose(Event event) {
  removeListener(SWT.Dispose, listener);
  notifyListeners(SWT.Dispose, event);
  event.type = SWT.None;

  tree.removeListener(SWT.Collapse, treeListener);
  tree.removeListener(SWT.Expand, treeListener);
  tree.removeListener(SWT.FocusIn, treeListener);
  tree.removeListener(SWT.MouseDown, treeListener);
  unhookRowColumnListeners();
  ScrollBar hBar = tree.getHorizontalBar();
  if (hBar != null) {
    hBar.removeListener(SWT.Selection, resizeListener);
  }
  ScrollBar vBar = tree.getVerticalBar();
  if (vBar != null) {
    vBar.removeListener(SWT.Selection, resizeListener);
  }
}

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

void onDispose(Event event) {
  removeListener(SWT.Dispose, listener);
  notifyListeners(SWT.Dispose, event);
  event.type = SWT.None;

  tree.removeListener(SWT.Collapse, treeListener);
  tree.removeListener(SWT.Expand, treeListener);
  tree.removeListener(SWT.FocusIn, treeListener);
  tree.removeListener(SWT.MouseDown, treeListener);
  unhookRowColumnListeners();
  ScrollBar hBar = tree.getHorizontalBar();
  if (hBar != null) {
    hBar.removeListener(SWT.Selection, resizeListener);
  }
  ScrollBar vBar = tree.getVerticalBar();
  if (vBar != null) {
    vBar.removeListener(SWT.Selection, resizeListener);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

/**
 * Actually sets the paint listener.
 *
 * @param color
 *            the foreground color to be used (if null removes the paint
 *            listener).
 */
private void setPaintListener(Color color) {
  if (Platform.OS_WIN32.equals(Platform.getOS())) {
    Tree tree = getTree();
    // Make sure we don't add the listener twice.
    tree.removeListener(SWT.PaintItem, treeItemSquaresPaintListener);
    tree.removeListener(SWT.PaintItem, treeItemArrowsPaintListener);
    if (color != null) {
      String treeArrowsMode = getTreeArrowsMode();
      if (TREE_ARROWS_MODE_TRIANGLE.equals(treeArrowsMode)) {
        tree.addListener(SWT.PaintItem, treeItemArrowsPaintListener);
      } else if (TREE_ARROWS_MODE_SQUARE.equals(treeArrowsMode)) {
        tree.addListener(SWT.PaintItem, treeItemSquaresPaintListener);
      } else if (!showedUnsupportedWarning) {
        System.err.println("Unsupported swt-tree-arrow-mode: " + treeArrowsMode);
        showedUnsupportedWarning = true;
      }
    }
  } else if (!showedUnsupportedWarning) {
    System.err.println("swt-tree-arrow-mode and swt-tree-arrow-color are not supported on this platform");
    showedUnsupportedWarning = true;
  }
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
 * Setup resources by name.
 */
private void setupResourcesByName() {
 resourcesUI.removeAll();
 resourcesUI.removeListener(SWT.Expand, this); // remove to prevent
                        // triggering while setting up
 resourcesUI.removeListener(SWT.Selection, this); // remove to prevent
                          // triggering while
                          // setting up
 resourcesUI.setHeaderVisible(true);    
 
 resourcesUIc1.setWidth(400);
 resourcesUIc1.setText("by-name xml resource");
 resourcesUIc2.setWidth(400);
 resourcesUIc2.setText("source of by-name resource");
  CandidateAndSource [] candidates = computeByNameCandidates();
 for (CandidateAndSource c : candidates) {
  TreeItem item = new TreeItem(resourcesUI, SWT.NULL, 0);     
  item.setText(new String [] {c.candidate, c.source});
  item.setData(c.candidate);
 }
 resourcesUI.addListener(SWT.Selection, this);
 browseButton.setEnabled(false);
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
 * Setup resources by location.
 */
protected void setupResourcesByLocation() {
 resourcesUI.removeAll();
 resourcesUI.removeListener(SWT.Expand, this);    // remove to prevent triggering while setting up
 resourcesUI.removeListener(SWT.Selection, this); // remove to prevent triggering while setting up
 resourcesUIc1.setWidth(500);
 resourcesUIc2.setWidth(0);
 resourcesUI.setHeaderVisible(false);
 
 TreeItem topItem = new TreeItem(resourcesUI, SWT.NONE);
 topItem.setText("Workspace");
 IWorkspaceRoot root = TAEConfiguratorPlugin.getWorkspace().getRoot().getWorkspace().getRoot();
 try {
 IResource[] projects = root.members();
 populate(topItem, projects);
 } catch (CoreException e) {
  throw new InternalErrorCDE("unhandled exception", e);
 }
 topItem.setExpanded(true);
 resourcesUI.addListener(SWT.Expand, this);
 resourcesUI.addListener(SWT.Selection, this);
}

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

getViewer().getTree().removeListener(SWT.EraseItem, CATEGORY_GRADIENT_DRAWER);
gradientListenerAdded = false;

代码示例来源:origin: org.xworker/xworker_swt

tree.removeListener(SWT.DefaultSelection, defaultSelectionListener);
tree.removeListener(SWT.Selection, selectionListener);

相关文章

Tree类方法