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