本文整理汇总了Java中com.google.gwt.user.client.ui.TreeItem.setState方法的典型用法代码示例。如果您正苦于以下问题:Java TreeItem.setState方法的具体用法?Java TreeItem.setState怎么用?Java TreeItem.setState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.TreeItem
的用法示例。
在下文中一共展示了TreeItem.setState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getBuiltInBlocksTree
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
/**
* Constructs a tree item for built-in blocks.
*
* @return tree item
*/
public TreeItem getBuiltInBlocksTree() {
initBundledImages();
TreeItem builtinNode = new TreeItem(new HTML("<span>" + MESSAGES.builtinBlocksLabel()
+ "</span>"));
for (final String drawerName : BUILTIN_DRAWER_NAMES) {
Image drawerImage = new Image(bundledImages.get(drawerName));
TreeItem itemNode = new TreeItem(new HTML("<span>" + drawerImage
+ getBuiltinDrawerNames(drawerName) + "</span>"));
SourceStructureExplorerItem sourceItem = new BlockSelectorItem() {
@Override
public void onSelected() {
fireBuiltinDrawerSelected(drawerName);
}
};
itemNode.setUserObject(sourceItem);
builtinNode.addItem(itemNode);
}
builtinNode.setState(true);
return builtinNode;
}
示例3: onSelection
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
@Override
public void onSelection(SelectionEvent<TreeItem> event) {
TreeItem item = event.getSelectedItem();
currentlySelected = item;
TreeItem child = item.getChild(0);
if ( child != null && child.getText().equals(DatasetWidget.LOADING) ) {
CategorySerializable cat = (CategorySerializable) item.getUserObject();
Util.getRPCService().getCategories(cat.getID(), null, categoryCallback);
}
// Open the item. Work around double firing bug.
// http://code.google.com/p/google-web-toolkit/issues/detail?id=3660&q=Tree%20selection&colspec=ID%20Type%20Status%20Owner%20Milestone%20Summary%20Stars
TreeItem selItem = event.getSelectedItem();
TreeItem parent = selItem.getParentItem();
selItem.getTree().setSelectedItem(parent, false); // null is ok
if(parent != null)
parent.setSelected(false); // not compulsory
selItem.setState(!selItem.getState(), false);
}
示例4: changeHelpPanel
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
/***********************************
****** HELP STUFF ******
***********************************/
private void changeHelpPanel(SubTabs subMenu) {
// change root item
rootItem.setText(subMenu + " Help");
rootItem.removeItems();
SubTabInterface subTabObj = getSubTab(subMenu);
if (subTabObj != null) {
HelpSliderConsts[] helpVals = subTabObj.getHelpSliderContent();
if (helpVals != null) {
for (int i = 0; i < helpVals.length; i++) {
TreeItem helpItem = new TreeItem(SafeHtmlUtils.fromString(helpVals[i].getTitle()));
TreeItem content = new TreeItem(SafeHtmlUtils.fromString(helpVals[i].getContent()));
helpItem.setState(false);
helpItem.addItem(content);
rootItem.addItem(helpItem);
}
}
}
rootItem.setState(true);
resize();
}
示例5: Mailboxes
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
/**
* Constructs a new mailboxes widget.
*/
public Mailboxes() {
Images images = GWT.create(Images.class);
tree = new Tree(images);
TreeItem root = new TreeItem(
imageItemHTML(images.home(), "[email protected]"));
tree.addItem(root);
addImageItem(root, "Inbox", images.inbox());
addImageItem(root, "Drafts", images.drafts());
addImageItem(root, "Templates", images.templates());
addImageItem(root, "Sent", images.sent());
addImageItem(root, "Trash", images.trash());
root.setState(true);
initWidget(tree);
}
示例6: buildTree
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
@Override
protected TreeItem buildTree() {
TreeItem itemNode = super.buildTree();
// Recursively build the tree for child components
for (MockComponent child : children) {
itemNode.addItem(child.buildTree());
}
itemNode.setState(expanded);
return itemNode;
}
示例7: getbatchFolderListView
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
/**
* This method creates tree view of batch class configuration for selected batch class.
*
* @param uiConfigList List<Node>
*/
public void getbatchFolderListView(List<Node> uiConfigList) {
batchClassFolderView.removeItems();
if (uncFolderList.getItemCount() > 0) {
importBatchClassUserOptionDTO.setUncFolder(uncFolderList.getValue(0));
}
if (uiConfigList != null && !uiConfigList.isEmpty()) {
importBatchClassUserOptionDTO.getUiConfigRoot().getChildren().clear();
for (Node rootNode : uiConfigList) {
Node node = new Node();
node.getLabel().setDisplayName(rootNode.getLabel().getDisplayName());
node.getLabel().setKey(rootNode.getLabel().getKey());
node.setParent(rootNode.getParent());
CheckBox checkBox = new CheckBox();
checkBox.setText(rootNode.getLabel().getDisplayName().trim());
TreeItem treeItem = new TreeItem(checkBox);
createUI(rootNode.getLabel().isMandatory(), checkBox, node, treeItem);
node.setParent(importBatchClassUserOptionDTO.getUiConfigRoot());
importBatchClassUserOptionDTO.getUiConfigRoot().getChildren().add(node);
if (rootNode.getChildren() != null && !rootNode.getChildren().isEmpty()) {
setImportFolderUI(treeItem, rootNode, node);
}
batchClassFolderView.addItem(treeItem);
treeItem.setState(Boolean.TRUE);
}
}
}
示例8: createFilterTreeItem
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private TreeItem createFilterTreeItem(Filter filter) {
FlexTable title = new FlexTable();
title.setWidget(0, 0, new DeleteFilterButton(filter, parentSubTab));
TreeItem filterItem = new TreeItem(title);
filterItem.setUserObject(filter);
filterItem.setState(true);
if (filter instanceof RowFilter) {
RowFilter rowFilter = (RowFilter) filter;
title.setWidget(0, 1, new Label(rowFilter.getVisibility()
+ rowFilter.getColumn().getDisplayHeader()));
title.setWidget(1, 1, new Label(" where column is " + rowFilter.getOperation() + " "
+ rowFilter.getInput()));
} else if (filter instanceof ColumnFilter) {
ColumnFilter columnFilter = (ColumnFilter) filter;
ArrayList<Column> columns = columnFilter.getColumnFilterHeaders();
if (columns.size() == 1) {
title.setWidget(0, 1, new Label(columnFilter.getVisibility().getDisplayText() + " "
+ columns.get(0).getDisplayHeader()));
} else {
title.setWidget(0, 1, new Label(columnFilter.getVisibility().getDisplayText() + " ..."));
for (Column column : columns) {
filterItem.addItem(new Label(column.getDisplayHeader()));
}
}
}
return filterItem;
}
示例9: createTerminationTreeItemContent
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private TerminationTreeItemContent createTerminationTreeItemContent(TerminationConfigOption terminationConfigOption,
TreeItem treeItem,
TerminationConfigModel terminationConfigModel) {
TerminationTreeItemContent terminationTreeItemContent = terminationTreeItemContentProvider.get();
terminationTreeItemContent.setTerminationConfigForm(this);
terminationTreeItemContent.setTerminationConfigOption(terminationConfigOption);
terminationTreeItemContent.setTreeItem(treeItem);
terminationTreeItemContent.setModel(terminationConfigModel);
treeItem.setUserObject(terminationTreeItemContent);
treeItem.setWidget(ElementWrapperWidget.getWidget(terminationTreeItemContent.getElement()));
treeItem.setState(true);
return terminationTreeItemContent;
}
示例10: Mailboxes
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
/**
* Constructs a new mailboxes widget with a bundle of images.
*/
public Mailboxes() {
tree = new Tree(images);
TreeItem root = new TreeItem(imageItemHTML(images.home(),
"[email protected]"));
tree.addItem(root);
this.root = root;
root.setState(true);
initWidget(tree);
}
示例11: listResources
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
public static void listResources(final ApplicationNode application, final TreeItem applicationTreeItem) {
Vector buttonTreeItems = WadlTreeRoot.removeChildrenXKeepButtons(applicationTreeItem, WadlXml.resourcesNode);
ResourcesNode resources = application.getResources();
if (resources != null) {
TreeItem resourcesTreeItem = new TreeItem(new ResourcesItem(resources, applicationTreeItem));
resourcesTreeItem.setUserObject(WadlXml.resourcesNode);
applicationTreeItem.addItem(resourcesTreeItem);
// list all resource items
ResourceItem.listResources(resources, resourcesTreeItem);
resourcesTreeItem.setState(SettingsDialog.treeItemsAlwaysOpen);
// close resources item
TreeItem resourcesCloseItem = new TreeItem(new GenericClosingItem(WadlXml.resourcesNode));
resourcesCloseItem.setUserObject(WadlXml.resourcesNode);
applicationTreeItem.addItem(resourcesCloseItem);
}
else {
if (!WadlTreeRoot.containsButton(buttonTreeItems, ApplicationItem.button + WadlXml.resourcesNode)) {
// add resources button
HorizontalPanel addResourcesPanel = new HorizontalPanel();
Button addResourcesButton = new Button(GuiFactory.strings.addResources());
addResourcesButton.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
application.addResources(new ResourcesNode(GuiFactory.strings.newResources(), application));
listResources(application, applicationTreeItem);
}
});
addResourcesPanel.add(addResourcesButton);
TreeItem addResourcesTreeItem = new TreeItem(addResourcesPanel);
addResourcesTreeItem.setUserObject(ApplicationItem.button + WadlXml.resourcesNode);
applicationTreeItem.addItem(addResourcesTreeItem);
}
}
WadlTreeRoot.addButtons(buttonTreeItems, applicationTreeItem);
}
示例12: addItemToNode
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private void addItemToNode(TreeItem treeItem, AbstractParameterWidget abstractParameterWidget,boolean show) {
treeItem.addItem(abstractParameterWidget);
widgets.put(abstractParameterWidget.parameter, abstractParameterWidget);
if (show) {
if (treeItem.getState()==false) {
treeItem.setState(true);
}
tree.setSelectedItem(abstractParameterWidget);
ensureVisible(abstractParameterWidget);
model.selectParameter(abstractParameterWidget.getParameter(),listener);
}
}
示例13: createRoster
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private void createRoster( final Roster roster )
{
final TreeItem treeItem = _tree.addItem( createRosterWidget( roster ) );
treeItem.setUserObject( roster );
treeItem.setState( true );
_treeViewMap.put( roster, treeItem );
}
示例14: addRoster
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private TreeItem addRoster( final Roster roster )
{
final TreeItem treeItem = _tree.addItem( createRosterWidget( roster ) );
treeItem.setUserObject( roster );
treeItem.setState( true );
_viewMap.put( roster, treeItem );
return treeItem;
}
示例15: displayError
import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private void displayError(String errorType, String errorMessage) {
jsonTree.removeItems();
jsonTree.setVisible(true);
TreeItem treeItem = jsonTree.addItem(SafeHtmlUtils.fromString(errorType));
treeItem.addItem(SafeHtmlUtils.fromString(errorMessage));
treeItem.setStyleName("JSON-JSONResponseObject");
treeItem.setState(true);
}