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


Java TreeItem.addTextItem方法代码示例

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


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

示例1: findTreeItem

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
/**
 * Find the TreeItem for a category. If it not exists, create it.
 * TODO: reconstruct
 * @param category category of a moduleId
 * @return TreeItem of the moduleId corresponding to the category
 */
public TreeItem findTreeItem(String category) {
	// default return the system Tree
	if (category.equals(""))
		return getSysTree();

	TreeItem treeItem = sysTreeMap.get(category);
	if (treeItem == null) {
		// Category doesn't exist, create new TreeItems
		int splitIdx = category.lastIndexOf('>');
		String parentCategory = category.substring(0, splitIdx);
		String cateName = category.substring(splitIdx + 1, category.length());
		TreeItem parentItem = findTreeItem(parentCategory);

		//      treeItem = parentItem.addTextItem(cateName);
		treeItem = parentItem.addTextItem(Globalization.getI18NString(cateName));
		treeItem.setState(true);
		sysTreeMap.put(category, treeItem);
	}
	return treeItem;
}
 
开发者ID:ICT-BDA,项目名称:EasyML,代码行数:27,代码来源:CopyOfModuleTree.java

示例2: setDateRange

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
@Override
public void setDateRange(List<PacketMonth> months) {
	clear();

	int lastYear = 0;
	TreeItem lastYearTreeItem = null;
	for (PacketMonth month : months) {
		if (month.year != lastYear) {
			lastYear = month.year;
			lastYearTreeItem = addTextItem(month.year + "年");
		}

		lastYearTreeItem.addTextItem(month.year + "年" + month.month + "月");
	}

	addTextItem(LABEL_ALL);
	addTextItem(LABEL_OLD);
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:19,代码来源:DateRangeSelectorViewImpl.java

示例3: setTheme

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
@Override
public void setTheme(List<List<String>> themess) {
	int index = 1;
	for (ProblemGenre genre : ProblemGenre.values()) {
		TreeItem treeItem = addTextItem(genre.toString());

		List<String> themes = themess.get(genre.getIndex());
		for (String theme : themes) {
			String value = index++ + " " + theme;
			treeItem.addTextItem(value);
		}
	}
}
 
开发者ID:nodchip,项目名称:QMAClone,代码行数:14,代码来源:ThemeSelectorViewImpl.java

示例4: addMusicSection

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
/**
 * Add a new section of music created by a specific composer.
 *
 * @param parent the parent {@link TreeItem} where the section will be added
 * @param label the label of the new section of music
 * @param composerWorks an array of works created by the composer
 */
@ShowcaseSource
private void addMusicSection(
    TreeItem parent, String label, String[] composerWorks) {
  TreeItem section = parent.addTextItem(label);
  for (String work : composerWorks) {
    section.addTextItem(work);
  }
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:16,代码来源:CwTree.java


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