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

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

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

Tree.isFocusControl介绍

暂无

代码示例

代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor

@Override
public boolean isFocusControl() {
  return treeViewer.getTree().isFocusControl() || filterText.isFocusControl();
}

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

private void openElement(Object data) {
  if (data == null)
    return;
  // This might or might not open an editor
  fParent.getViewer().fireMenuSelection(data);
  boolean treeHasFocus= !fShell.isDisposed() && fDropDownViewer.getTree().isFocusControl();
  if (JavaPlugin.DEBUG_BREADCRUMB_ITEM_DROP_DOWN) {
    System.out.println("	isDisposed: " + fShell.isDisposed()); //$NON-NLS-1$
    System.out.println("	shell hasFocus: " + (!fShell.isDisposed() && fShell.isFocusControl())); //$NON-NLS-1$
    System.out.println("	tree hasFocus: " + treeHasFocus); //$NON-NLS-1$
  }
  if (fShell.isDisposed())
    return;
  if (!treeHasFocus) {
    fShell.close();
    return;
  }
  toggleExpansionState(data);
}

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

private void openElement(Object data) {
  if (data == null)
    return;
  // This might or might not open an editor
  fParent.getViewer().fireMenuSelection(data);
  boolean treeHasFocus= !fShell.isDisposed() && fDropDownViewer.getTree().isFocusControl();
  if (JavaPlugin.DEBUG_BREADCRUMB_ITEM_DROP_DOWN) {
    System.out.println("	isDisposed: " + fShell.isDisposed()); //$NON-NLS-1$
    System.out.println("	shell hasFocus: " + (!fShell.isDisposed() && fShell.isFocusControl())); //$NON-NLS-1$
    System.out.println("	tree hasFocus: " + treeHasFocus); //$NON-NLS-1$
  }
  if (fShell.isDisposed())
    return;
  if (!treeHasFocus) {
    fShell.close();
    return;
  }
  toggleExpansionState(data);
}

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

public boolean isFocusControl() {
  return filteredTree.isFocusControl() || filteredTree.getFilterControl().isFocusControl()
      || filteredTree.getViewer().getTree().isFocusControl();
}

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

/**
 * Called when the given element was selected in the viewer.  It causes the
 * breadcrumb viewer to fire an opened event.  If the viewer loses focus
 * as a result of the open operation, then the drop-down is closed.
 * Otherwise the selected element is expanded.
 *
 * @param selection The selection to open.
 */
protected void openElement(ISelection selection) {
  if (selection == null || !(selection instanceof ITreeSelection) || selection.isEmpty()) {
    return;
  }
  // This might or might not open an editor
  fDropDownSite.notifySelection(selection);
  Tree tree = fDropDownViewer.getTree();
  boolean treeHasFocus= !tree.isDisposed() && tree.isFocusControl();
  if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) {
    DebugUIPlugin.trace("    isDisposed: " + tree.isDisposed()); //$NON-NLS-1$
    DebugUIPlugin.trace("    shell hasFocus: " + (!tree.isDisposed() && tree.isFocusControl())); //$NON-NLS-1$
    DebugUIPlugin.trace("    tree hasFocus: " + treeHasFocus); //$NON-NLS-1$
  }
  if (tree.isDisposed()) {
    return;
  }
  if (!treeHasFocus) {
    fDropDownSite.close();
    return;
  }
  toggleExpansionState( ((ITreeSelection)selection).getPaths()[0]);
}

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

if (sidebar.getTree().isFocusControl()) {
  color1 = ColorCache.getSchemedColor(gc.getDevice(), "#166688");
  color2 = ColorCache.getSchemedColor(gc.getDevice(), "#1c2458");

相关文章

Tree类方法