本文整理了Java中org.eclipse.swt.widgets.Tree.select()
方法的一些代码示例,展示了Tree.select()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.select()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Tree
类名称:Tree
方法名:select
[英]Selects an item in the receiver. If the item was already selected, it remains selected.
[中]在接收器中选择一个项目。如果该项目已被选中,它将保持选中状态。
代码示例来源:origin: caoxinyu/RedisClient
tree.select(rootRedisServers);
代码示例来源:origin: org.eclipse.egit/ui
public void widgetSelected(SelectionEvent e) {
tree.select((TreeItem) e.item);
updateControls();
}
});
代码示例来源:origin: cbeust/testng-eclipse
@Override
public void setSelectedTest(String testId) {
if (testId == null) return;
ITreeItem node = m_treeItemMap.get(testId);
if (node != null) {
m_tree.select(node.getTreeItem());
} else {
m_tree.deselectAll();
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
void select (int /*long*/ hItem, TVITEM tvItem) {
while (hItem != 0) {
tvItem.hItem = hItem;
OS.SendMessage (handle, OS.TVM_SETITEM, 0, tvItem);
int state = (int)/*64*/OS.SendMessage (handle, OS.TVM_GETITEMSTATE, hItem, OS.TVIS_EXPANDED);
if ((state & OS.TVIS_EXPANDED) != 0) {
int /*long*/ hFirstItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_CHILD, hItem);
select (hFirstItem, tvItem);
}
hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_NEXT, hItem);
}
}
代码示例来源:origin: BiglySoftware/BiglyBT
private void swt_show() {
if (swtItem == null) {
showonSWTItemSet = true;
return;
}
showonSWTItemSet = false;
if (!swt_build()) {
return;
}
triggerOpenListeners();
swtItem.getParent().select(swtItem);
swtItem.getParent().showItem(swtItem);
super.show();
}
代码示例来源:origin: org.xworker/xworker_swt
tree.select(tree.getItems()[0]);
handeSelection(self, tree, tree.getSelection()[0], actionContext);
tree.select(nextItem);
handeSelection(self, tree, tree.getSelection()[0], actionContext);
}else if(item.getItems().length > 0){
tree.select(item.getItems()[0]);
handeSelection(self, tree, tree.getSelection()[0], actionContext);
tree.select(item.getItems()[0]);
handeSelection(self, tree, tree.getSelection()[0], actionContext);
tree.select(nextItem);
handeSelection(self, tree, tree.getSelection()[0], actionContext);
tree.select(item.getParentItem());
handeSelection(self, tree, tree.getSelection()[0], actionContext);
代码示例来源:origin: org.xworker/xworker_swt
thingForm.doAction("setDescriptor", actionContext, UtilMap.toMap(new Object[]{"descriptor", paramsThing}));
thingForm.doAction("setValues", actionContext, UtilMap.toMap(new Object[]{"values", params}));
item.getParent().select(item);
return true;
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
/**
* Selects all of the items in the receiver.
* <p>
* If the receiver is single-select, do nothing.
* </p>
*
* @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>
*/
public void selectAll () {
checkWidget ();
if ((style & SWT.SINGLE) != 0) return;
TVITEM tvItem = new TVITEM ();
tvItem.mask = OS.TVIF_HANDLE | OS.TVIF_STATE;
tvItem.state = OS.TVIS_SELECTED;
tvItem.stateMask = OS.TVIS_SELECTED;
int /*long*/ oldProc = OS.GetWindowLongPtr (handle, OS.GWLP_WNDPROC);
OS.SetWindowLongPtr (handle, OS.GWLP_WNDPROC, TreeProc);
int /*long*/ hItem = OS.SendMessage (handle, OS.TVM_GETNEXTITEM, OS.TVGN_ROOT, 0);
select (hItem, tvItem);
OS.SetWindowLongPtr (handle, OS.GWLP_WNDPROC, oldProc);
}
代码示例来源:origin: org.xworker/xworker_swt
childTree.select(treeItem);
actionContext.peek().put("thing", obj);
childTreeSelection(actionContext);
代码示例来源:origin: org.xworker/xworker_swt
public static void initItemAtTree(Object parentItem, Item item, ActionContext actionContext, Control control){
TreeItem treeItem = null;
if(parentItem instanceof Tree){
treeItem = new TreeItem((Tree) parentItem, SWT.None);
}else{
treeItem = new TreeItem((TreeItem) parentItem, SWT.None);
}
XWorkerTreeUtil.initItem(treeItem, item.thing, actionContext);
treeItem.setData(item);
for(Item childItem : item.child){
initItemAtTree(treeItem, childItem, actionContext, control);
}
treeItem.setExpanded(true);
if(item.control == control){
treeItem.getParent().select(treeItem);
treeItem.getParent().showItem(treeItem);
actionContext.getScope(0).put("item", item);
}
}
代码示例来源:origin: org.xworker/xworker_swt
public static void initOutlineItem(Thing thing, Object parentItem, Thing rootThing, Tree outlineTree, Object outlineTreeSelection, ActionContext actionContext){
TreeItem treeItem = null;
if(parentItem instanceof Tree){
treeItem = new TreeItem((Tree) parentItem, SWT.NONE);
}else if(parentItem instanceof TreeItem){
treeItem = new TreeItem((TreeItem) parentItem, SWT.NONE);
}
treeItem.setData(thing);
ThingMetadata metadata = thing.getMetadata();
treeItem.setText(metadata.getLabel() + " (" + thing.getThingName() + ")");
XWorkerTreeUtil.initItem(treeItem, thing, actionContext);
for(Thing child : thing.getChilds()){
initOutlineItem(child, treeItem, rootThing, outlineTree, outlineTreeSelection, actionContext);
}
treeItem.setExpanded(true);
if(thing == rootThing){
outlineTree.select(treeItem);
((Listener) outlineTreeSelection).handleEvent(null);
}
}
内容来源于网络,如有侵权,请联系作者删除!