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


Java Tree.getItemCount方法代码示例

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


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

示例1: saveState

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
public void saveState() {
	List<String> nodes = new ArrayList<String>();
	nodes.add(iStackPanel.getStackText(iStackPanel.getSelectedIndex()));
	for (int i = 0; i < iStackPanel.getWidgetCount(); i++) {
		if (iStackPanel.getWidget(i) instanceof Tree) {
			Tree t = (Tree)iStackPanel.getWidget(i);
			for (int j = 0; j < t.getItemCount(); j++) {
				openedNodes(nodes, t.getItem(j), iStackPanel.getStackText(i));
			}
		}
	}
	String sideBarCookie = "";
	for (String node: nodes) {
		if (!sideBarCookie.isEmpty()) sideBarCookie += "|";
		sideBarCookie += node;
	}
	Cookies.setCookie("UniTime:MobileMenu", sideBarCookie);
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:UniTimeMobileMenu.java

示例2: restoreState

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
public void restoreState() {
	Set<String> nodes = new HashSet<String>();
	String sideBarCookie = Cookies.getCookie("UniTime:MobileMenu");
	if (sideBarCookie != null)
		for (String node: sideBarCookie.split("\\|"))
			nodes.add(node);
	for (int i = 0 ; i < iStackPanel.getWidgetCount(); i++) {
		if (nodes.contains(iStackPanel.getStackText(i))) {
			iStackPanel.showStack(i);
		}
		if (iStackPanel.getWidget(i) instanceof Tree) {
			Tree t = (Tree)iStackPanel.getWidget(i);
			for (int j = 0; j < t.getItemCount(); j++) {
				openNodes(nodes, t.getItem(j), iStackPanel.getStackText(i));
			}
		}
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:19,代码来源:UniTimeMobileMenu.java

示例3: restoreState

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
public void restoreState() {
	Set<String> nodes = new HashSet<String>();
	String sideBarCookie = Cookies.getCookie("UniTime:SideBar");
	if (sideBarCookie != null)
		for (String node: sideBarCookie.split("\\|"))
			nodes.add(node);
	iDisclosurePanel.setOpen(nodes.contains("Root") || sideBarCookie == null);
	if (iUseStackPanel)
		for (int i = 0 ; i < iStackPanel.getWidgetCount(); i++) {
			if (nodes.contains(iStackPanel.getStackText(i))) {
				iStackPanel.showStack(i);
			}
			if (iStackPanel.getWidget(i) instanceof Tree) {
				Tree t = (Tree)iStackPanel.getWidget(i);
				for (int j = 0; j < t.getItemCount(); j++) {
					openNodes(nodes, t.getItem(j), iStackPanel.getStackText(i));
				}
			}
		}
	else
		for (int i = 0; i < iTree.getItemCount(); i++) {
			openNodes(nodes, iTree.getItem(i), null);
		}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:25,代码来源:UniTimeSideBar.java

示例4: saveState

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
public void saveState() {
	List<String> nodes = new ArrayList<String>();
	if (iUseStackPanel) {
		nodes.add(iStackPanel.getStackText(iStackPanel.getSelectedIndex()));
		for (int i = 0; i < iStackPanel.getWidgetCount(); i++) {
			if (iStackPanel.getWidget(i) instanceof Tree) {
				Tree t = (Tree)iStackPanel.getWidget(i);
				for (int j = 0; j < t.getItemCount(); j++) {
					openedNodes(nodes, t.getItem(j), iStackPanel.getStackText(i));
				}
			}
		}
	} else {
		for (int i = 0; i < iTree.getItemCount(); i++) {
			openedNodes(nodes, iTree.getItem(i), null);
		}
	}
	String sideBarCookie = "";
	if (iDisclosurePanel.isOpen()) sideBarCookie += "Root";
	for (String node: nodes) {
		if (!sideBarCookie.isEmpty()) sideBarCookie += "|";
		sideBarCookie += node;
	}
	sideBarCookie += "|W:" + iPanel.getElement().getClientWidth();
	Cookies.setCookie("UniTime:SideBar", sideBarCookie);
	resizeWideTables();
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:28,代码来源:UniTimeSideBar.java

示例5: getTreeItem

import com.google.gwt.user.client.ui.Tree; //导入方法依赖的package包/类
/**
 * Allows to retrieve the tree item by name
 * @param tree the tree to take the item from
 * @param itemText the text of the item we want to get the sate of
 * @return the tree item with the given text, or null if there is no such item
 */
private static TreeItem getTreeItem( final Tree tree, final String itemText ) {
	if( tree != null ) {
		for( int i = 0; i < tree.getItemCount(); i++ ) {
			TreeItem oldTreeItem = tree.getItem( i );
			if( oldTreeItem.getText().equals( itemText ) ) {
				return oldTreeItem;
			}
		}
	}
	return null;
}
 
开发者ID:ivan-zapreev,项目名称:x-cure-chat,代码行数:18,代码来源:ChatRoomUI.java


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