本文整理汇总了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);
}
示例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));
}
}
}
}
示例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);
}
}
示例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();
}
示例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;
}