當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。