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


Java TreeItem.setWidget方法代码示例

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


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

示例1: addTmpFolderCreate

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
/**
 * Add temporary folder on creation
 */
public void addTmpFolderCreate() {
	if (folderAction == ACTION_NONE) {
		folderAction = ACTION_CREATE;
		FolderTextBox newFolder = new FolderTextBox();
		tmpFolder = new TreeItem();
		tmpFolder.setWidget(newFolder);
		tmpFolder.setStyleName("okm-TreeItem");
		newFolder.reset();
		newFolder.setText(Main.i18n("tree.folder.new"));
		actualItem.addItem(tmpFolder);
		actualItem.setState(true);
		actualItem.setSelected(false);
		tmpFolder.setSelected(true);
		actualItem = tmpFolder;
		// When we create a new folder we enables selection ( after it,
		// we'll return to disable) for a normal
		// use of the input (if not, cursor and selections not runs
		// propertly )
		rootItem.removeStyleName("okm-DisableSelect"); // Disables drag and
		// drop browser text
		// selection)
		newFolder.setFocus();
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:28,代码来源:FolderTree.java

示例2: 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;
}
 
开发者ID:kiegroup,项目名称:optaplanner-wb,代码行数:14,代码来源:TerminationConfigForm.java

示例3: addItem

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private TreeItem addItem(Tree tree, ScreenMenuItem widget) {
	TreeItem childItem = new TreeItem();
	childItem.setWidget(widget);
	tree.addItem(childItem);

	widget.addClickListener(this);
	
	return(childItem);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:10,代码来源:NavigationScreen.java

示例4: addItem

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private TreeItem addItem(Tree tree, ScreenMenuItem widget) {
	TreeItem childItem = new TreeItem();
	childItem.setWidget(widget);
	tree.addItem(childItem);

	widget.addClickListener(this);

	return(childItem);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:10,代码来源:ModelCreatorNavigation.java

示例5: createTreeElement

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private void createTreeElement(
    final TreeItem root, String changeName, List<RefactoringPreview> children) {
  FlowPanel element = new FlowPanel();
  element.getElement().getStyle().setFloat(LEFT);
  CheckBox itemCheckBox = new CheckBox();
  itemCheckBox.setValue(true);
  itemCheckBox.getElement().getStyle().setFloat(LEFT);
  itemCheckBox.getElement().getStyle().setMarginTop(3, PX);
  Label name = new Label(changeName);
  name.addClickHandler(
      event -> {
        delegate.onSelectionChanged(containerChanges.get(root));
        root.setSelected(true);
      });
  name.getElement().getStyle().setFloat(LEFT);
  element.add(itemCheckBox);
  element.add(name);

  root.setWidget(element);

  element.getElement().getParentElement().getStyle().setMargin(1, PX);

  itemCheckBox.addValueChangeHandler(
      event -> {
        checkChildrenState(root, event.getValue());
        checkParentState(root, event.getValue());

        RefactoringPreview change = containerChanges.get(root);
        change.setEnabled(event.getValue());

        delegate.onEnabledStateChanged(change);
      });

  if (children.isEmpty()) {
    return;
  }

  for (RefactoringPreview child : children) {
    TreeItem treeItem = new TreeItem();
    containerChanges.put(treeItem, child);
    createTreeElement(treeItem, child.getText(), child.getChildrens());
    root.addItem(treeItem);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:45,代码来源:PreviewViewImpl.java

示例6: newTreeItem

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
protected TreeItem newTreeItem(Object data, final boolean root) {
	
	Widget w = this.control.getWidget(data);
	final TreeItem item = new TreeItem();
	
	item.setUserObject(data);
	item.setWidget(w);
	
	// Need to this here since we call the auto open and that
	// need to have the tree callback setup.
	if (root) {
		tree.addItem(item);
	}
	
	this.control.getChildCount(data, new AsyncCallback() {

		public void onFailure(Throwable caught) {
			// TODO Auto-generated method stub
			
		}

		public void onSuccess(Object result) {
			if (result instanceof Integer) {
				int value = ((Integer)result).intValue();
				if (value > 0) {
					TreeItem countItem = new TreeItem("Populating....");
					countItem.setUserObject(result);	
					item.addItem(countItem);
					// Always open root item.
					
					if (root && control.isRootState()) {
						System.out.println("Default open root Tree Item! '" + item.getUserObject() +"'");
						item.setState(true, true);
					}
					
				}
				
			}
		}
		
	});
	return(item);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:44,代码来源:CITreeWidget.java

示例7: addItem

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
protected void addItem(TreeItem parentItem, ScreenMenuItem widget) {
	TreeItem childItem = new TreeItem();
	childItem.setWidget(widget);
	parentItem.addItem(childItem);

	widget.addClickListener(this);

	
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:10,代码来源:NavigationScreen.java


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