当前位置: 首页>>代码示例>>Java>>正文


Java TreeItem.getItems方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.TreeItem.getItems方法的典型用法代码示例。如果您正苦于以下问题:Java TreeItem.getItems方法的具体用法?Java TreeItem.getItems怎么用?Java TreeItem.getItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.TreeItem的用法示例。


在下文中一共展示了TreeItem.getItems方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fillCheckedList

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
private void fillCheckedList(TreeItem parent, List<String> csSourceData) {
	if (csSourceData != null && !csSourceData.isEmpty()) {
		TreeItem[] items = null;
		
		if (parent == null) {
			items = checkboxTreeViewer.getTree().getItems();
		}
		else {
			items = parent.getItems();
			
			TVObject tvo = (TVObject) parent.getData();
			String tvoSourceData = tvo.getSourceData();
			if (csSourceData.contains(tvoSourceData)) {
				int index = csSourceData.indexOf(tvoSourceData);
				if (index == 0)
					checkedList.add(0,tvo);
				else
					checkedList.add(tvo);
			}
		}
		
		for (int i=0; i<items.length; i++) {
			fillCheckedList(items[i], csSourceData);
		}
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:27,代码来源:MobilePickerComposite.java

示例2: findModelItem

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
private TVObject findModelItem(TreeItem parent, String modelPath) {
	if (modelPath != null && !modelPath.isEmpty()) {
		TreeItem[] items = null;
		
		items = parent == null ? modelTreeViewer.getTree().getItems() : parent.getItems();
		for (int i=0; i<items.length; i++) {
			TreeItem treeItem = items[i];
			TVObject tvo = (TVObject) treeItem.getData();
			if (tvo != null) {
				String tvoSourcePath = tvo.getSourcePath().replaceAll("\\?\\.", ".");
				if (modelPath.startsWith(tvoSourcePath.replaceFirst("root", ""))) {
					if (modelPath.equals(tvoSourcePath.replaceFirst("root", ""))) {
						return tvo;
					}
					return findModelItem(items[i], modelPath);
				}
			}
		}
	}
	return null;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:22,代码来源:MobilePickerComposite.java

示例3: getSelectedItems

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
private void getSelectedItems(TreeItem[] items, List<Node> selectedItems) {
	if (items == null) {
		return;
	}
	for (TreeItem item : items) {
		Node parent = new Node(item.getText(), true);
		TreeItem[] children = item.getItems();
		if (children != null) {
			boolean selected = false;
			for (TreeItem child : children) {
				if (child.getChecked()) {
					parent.addChild(new Node(child.getText(), false));
					selected = true;
				}
			}
			if (selected) {
				nodeListManager.addSelectedNode(parent);
			}
		}
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:22,代码来源:SelectClassPage.java

示例4: expandAll

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
public void expandAll(TreeItem treeItem) {
	TreeItem[] treeItems = treeItem.getItems();
	treeItem.setExpanded(true);
	for (TreeItem sub : treeItems) {
		expandAll(sub);
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:8,代码来源:TwsDomTree.java

示例5: setDirectoryExpandedStates

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
/**
 * Change the "expanded" state of the node.
 */
protected void setDirectoryExpandedStates(TreeItem treeItem, boolean expand) {
	treeItem.setExpanded(expand);
	TreeItem[] treeItems = treeItem.getItems();
	for (int i=0; i<treeItems.length; i++) {
		setDirectoryExpandedStates(treeItems[i], expand);
	}
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:11,代码来源:DiskExplorerTab.java

示例6: searchForMoreNodes

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
/**
 * Recursive support method for the refreshing of the directory tree: Search for
 * nodes that the current item has as subitems, invoke the recursive search of
 * them and finally refresh them.
 * @param item The TreeItem to process.
 */
private void searchForMoreNodes(TreeItem item) {
	TreeItem[] items = item.getItems();
	for (int a = 0; a < items.length; a++) {
		// Recursion.
		if (!(items[a].getData() instanceof JarFileEntry))
			searchForMoreNodes(items[a]);
	}
	refreshNode(item);

}
 
开发者ID:wwu-pi,项目名称:tap17-muggl-javaee,代码行数:17,代码来源:FileSelectionComposite.java

示例7: selectAllSubItems

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
private void selectAllSubItems(TreeItem selectedTreeItem) {
	TreeItem[] selection = selectedTreeItem.getItems();
	for (int i = 0; i < selection.length; i++) {
		selection[i].setChecked(selectedTreeItem.getChecked());
		selectAllSubItems(selection[i]);
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:8,代码来源:SelectClassPage.java

示例8: selectAllParentItems

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
private void selectAllParentItems(TreeItem selectedTreeItem) {
	TreeItem parentTreeItem = selectedTreeItem.getParentItem();
	// 当有一个未被选中的时候,取消父节点的选择,当全部选中,则父节点选中
	if (parentTreeItem != null) {
		TreeItem[] parentSubItems = parentTreeItem.getItems();
		boolean allChecked = true;
		boolean isGrayed = false;
		for (int i = 0; i < parentSubItems.length; i++) {
			allChecked = parentSubItems[i].getChecked();
			if (!allChecked) {
				break;
			}
		}
		for (int i = 0; i < parentSubItems.length; i++) {
			if (parentSubItems[i].getChecked()) {
				isGrayed = true;
				break;
			}
		}

		if (isGrayed && allChecked) {
			parentTreeItem.setChecked(allChecked);
			parentTreeItem.setGrayed(!isGrayed);
		}
		if (!allChecked) {
			parentTreeItem.setChecked(isGrayed);
			parentTreeItem.setGrayed(isGrayed);
		}
		selectAllParentItems(parentTreeItem);
	}
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:32,代码来源:SelectClassPage.java

示例9: dispose

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
private void dispose(TreeItem item) {
	if (item != null) {
		if (item.getItems() != null) {
			for (TreeItem child : item.getItems()) {
				dispose(child);
			}
		}
	}
	item.getImage().dispose();
	item.dispose();
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:12,代码来源:SelectClassPage.java

示例10: visitTreeItem

import org.eclipse.swt.widgets.TreeItem; //导入方法依赖的package包/类
protected void visitTreeItem(TreeItem treeItem, NodeStats stats) {		
	SchemaNode node = (SchemaNode) treeItem.getData();
	if (node != null) {
		stats.count(node.getAvroNode());
		TreeItem[] items = treeItem.getItems();
		for (TreeItem item : items) {
			visitTreeItem(item, stats);
		}
	}
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:11,代码来源:CountTreeItemsHandler.java


注:本文中的org.eclipse.swt.widgets.TreeItem.getItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。