本文整理了Java中org.eclipse.swt.widgets.Tree.setTopItem()
方法的一些代码示例,展示了Tree.setTopItem()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.setTopItem()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:setTopItem
[英]Sets the item which is currently at the top of the receiver. This item can change when items are expanded, collapsed, scrolled or new items are added or removed.
[中]设置当前位于接收器顶部的项目。当项目展开、折叠、滚动或添加或删除新项目时,此项目可能会更改。
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
public void reveal(TreePath path, int index) {
Widget item = findItem(path);
TreeItem[] children = null;
if (item instanceof TreeItem) {
children = ((TreeItem)item).getItems();
} else if (item instanceof Tree) {
children = ((Tree)item).getItems();
}
if (children != null && index < children.length) {
getTree().setTopItem(children[index]);
}
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
@Override
public void mouseScrolled(MouseEvent e) {
// scroll only when MOD1 is pressed
if ((e.stateMask & SWT.MOD1) == SWT.MOD1 && fTree != null) {
TreeItem item = fTree.getTopItem();
if (item != null) {
TreeItem nextItem = item;
for (int i = 0; i < fSkipLines; i++) {
TreeItem foundItem = null;
if (e.count < 0) // determines scrolling direction
foundItem = NextItem(fTree, nextItem);
else
foundItem = PreviousItem(fTree, nextItem);
if (foundItem == null) {
break;
}
nextItem = foundItem;
}
fTree.setTopItem(nextItem);
}
}
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private static void revealTopItem(Tree tree, int[] indexPath) {
TreeItem itemFound = null;
for (int i = indexPath.length - 1; i >= 0; i--) {
int index = indexPath[i];
if (itemFound != null) {
itemFound = (itemFound.getItemCount() > index) ? itemFound.getItem(indexPath[i]) : null;
} else if (i == indexPath.length - 1) {
itemFound = (tree.getItemCount() > index) ? tree.getItem(indexPath[i]) : null;
}
}
if (itemFound != null) {
tree.setTopItem(itemFound);
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
tree.setTopItem(selection[0]);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
tree.setTopItem(selection[0]);
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
treeViewer.getTree().setTopItem(items[0]);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
treeViewer.getTree().setTopItem(items[0]);
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
if (items.length > 0
&& getViewer().getTree().getSelectionCount() == 0) {
treeViewer.getTree().setTopItem(items[0]);
代码示例来源:origin: org.codehaus.openxma/xmartclient
tree_.setTopItem(node2item(wModel_.getNode(topKey)));
代码示例来源:origin: BiglySoftware/BiglyBT
tree.setTopItem(topItem);
tree.setRedraw(true);
内容来源于网络,如有侵权,请联系作者删除!