org.eclipse.swt.widgets.Tree#showSelection ( )源码实例Demo

下面列出了org.eclipse.swt.widgets.Tree#showSelection ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: translationstudio8   文件: ColumnChooserDialog.java
private void selectAllChildren(Tree tree, TreeItem treeItem) {
	Collection<TreeItem> selectedLeaves = ArrayUtil.asCollection(tree.getSelection());
	if(isColumnGroupLeaf(treeItem)){
		selectedLeaves.addAll(ArrayUtil.asCollection(treeItem.getItems()));
	}
	tree.setSelection(selectedLeaves.toArray(new TreeItem[]{}));
	tree.showSelection();
}
 
源代码2 项目: translationstudio8   文件: ColumnChooserDialog.java
private void unSelectAllChildren(Tree tree, TreeItem treeItem) {
	Collection<TreeItem> selectedLeaves = ArrayUtil.asCollection(tree.getSelection());
	if(isColumnGroupLeaf(treeItem)){
		selectedLeaves.removeAll(ArrayUtil.asCollection(treeItem.getItems()));
	}
	tree.setSelection(selectedLeaves.toArray(new TreeItem[]{}));
	tree.showSelection();
}
 
源代码3 项目: translationstudio8   文件: ColumnChooserDialog.java
/**
 * Marks the leaves in the tree as selected
 * @param tree containing the leaves
 * @param indexes index of the leaf in the tree
 */
protected void setSelection(Tree tree, List<Integer> indexes) {
	List<TreeItem> selectedLeaves = new ArrayList<TreeItem>();

	for (Integer leafIndex : indexes) {
		selectedLeaves.add(tree.getItem(leafIndex.intValue()));
	}
	tree.setSelection(selectedLeaves.toArray(new TreeItem[] {}));
	tree.showSelection();
}
 
源代码4 项目: tmxeditor8   文件: ColumnChooserDialog.java
private void selectAllChildren(Tree tree, TreeItem treeItem) {
	Collection<TreeItem> selectedLeaves = ArrayUtil.asCollection(tree.getSelection());
	if(isColumnGroupLeaf(treeItem)){
		selectedLeaves.addAll(ArrayUtil.asCollection(treeItem.getItems()));
	}
	tree.setSelection(selectedLeaves.toArray(new TreeItem[]{}));
	tree.showSelection();
}
 
源代码5 项目: tmxeditor8   文件: ColumnChooserDialog.java
private void unSelectAllChildren(Tree tree, TreeItem treeItem) {
	Collection<TreeItem> selectedLeaves = ArrayUtil.asCollection(tree.getSelection());
	if(isColumnGroupLeaf(treeItem)){
		selectedLeaves.removeAll(ArrayUtil.asCollection(treeItem.getItems()));
	}
	tree.setSelection(selectedLeaves.toArray(new TreeItem[]{}));
	tree.showSelection();
}
 
源代码6 项目: tmxeditor8   文件: ColumnChooserDialog.java
/**
 * Marks the leaves in the tree as selected
 * @param tree containing the leaves
 * @param indexes index of the leaf in the tree
 */
protected void setSelection(Tree tree, List<Integer> indexes) {
	List<TreeItem> selectedLeaves = new ArrayList<TreeItem>();

	for (Integer leafIndex : indexes) {
		selectedLeaves.add(tree.getItem(leafIndex.intValue()));
	}
	tree.setSelection(selectedLeaves.toArray(new TreeItem[] {}));
	tree.showSelection();
}