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


Java TreeItem.setStyleName方法代码示例

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


在下文中一共展示了TreeItem.setStyleName方法的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: onSuccess

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
public void onSuccess(List<GWTFolder> result) {
	boolean directAdd = true;

	// If has no childs directly add values is permited
	if (actualItem.getChildCount() > 0) {
		directAdd = false;
		// to prevent remote folder remove it disables all tree branch 
		// items and after sequentially activate
		hideAllBranch(actualItem);
	}

	// On refreshing not refreshed the actual item values but must 
	// ensure that has childs value is consistent
	if (result.isEmpty()) {
		((GWTFolder) actualItem.getUserObject()).setHasChildren(false);
	} else {
		((GWTFolder) actualItem.getUserObject()).setHasChildren(true);
	}

	// Ads folders childs if exists
	for (Iterator<GWTFolder> it = result.iterator(); it.hasNext(); ) {
		GWTFolder folder = it.next();
		TreeItem folderItem = new TreeItem(folder.getName());
		folderItem.setUserObject(folder);
		folderItem.setStyleName("okm-TreeItem");

		// If has no childs directly add values is permited, else 
		// evalues each node to refresh, remove or add
		if (directAdd) {
			evaluesFolderIcon(folderItem);
			actualItem.addItem(folderItem);
		} else {
			// sequentially activate items and refreshes values
			addFolder(actualItem, folderItem);
		}
	}

	actualItem.setState(true);
	evaluesFolderIcon(actualItem);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:41,代码来源:FolderSelectTree.java

示例3: onSuccess

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
public void onSuccess(GWTFolder result) {
	actualItem = actualItem.getParentItem(); // Restores the real
	// actualItem
	tmpFolder.setSelected(false);
	actualItem.setSelected(true);
	actualItem.setState(true);
	GWTFolder folder = result;
	GWTFolder folderItem = (GWTFolder) actualItem.getUserObject();
	folderItem.setHasChildren(true);
	actualItem.removeItem(tmpFolder);
	TreeItem newFolder = new TreeItem(Util.imageItemHTML("img/menuitem_empty.gif", folder.getName(),
			"top"));
	newFolder.setUserObject(folder);
	newFolder.setStyleName("okm-TreeItem");
	actualItem.addItem(newFolder);
	evaluesFolderIcon(newFolder);
	evaluesFolderIcon(actualItem);
	Main.get().mainPanel.desktop.navigator.status.unsetFlagCreate();
	if (Main.get().mainPanel.desktop.navigator.getStackIndex() != UIDesktopConstants.NAVIGATOR_CATEGORIES) {
		Main.get().mainPanel.desktop.browser.fileBrowser.status.setFlagFolderChilds();
		Main.get().mainPanel.desktop.browser.fileBrowser.addFolder(folder);
	}

	// Special case when we are creating a folder and selects other tree
	// item before removing tmp folder
	// must changing to the real item selected
	if (otherTreeItemSelected != null) {
		onTreeItemSelected(otherTreeItemSelected);
		otherTreeItemSelected = null;
	}

	folderAction = ACTION_NONE;
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:34,代码来源:FolderTree.java

示例4: 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);
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:9,代码来源:JSON.java

示例5: displayJSONObject

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
private void displayJSONObject(JSONValue jsonValue) {
  jsonTree.removeItems();
  jsonTree.setVisible(true);
  TreeItem treeItem = jsonTree.addItem(SafeHtmlUtils.fromString("JSON Response"));
  addChildren(treeItem, jsonValue);
  treeItem.setStyleName("JSON-JSONResponseObject");
  treeItem.setState(true);
}
 
开发者ID:Peergos,项目名称:Peergos,代码行数:9,代码来源:JSON.java

示例6: onSuccess

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
public void onSuccess(List<GWTFolder> result) {
	boolean directAdd = true;

	// If has no childs directly add values is permited
	if (actualItem.getChildCount() > 0) {
		directAdd = false;
		// to prevent remote folder remove it disables all tree branch 
		// items and after sequentially activate
		hideAllBranch(actualItem);
	}

	// On refreshing not refreshed the actual item values but must 
	// ensure that has childs value is consistent
	if (result.isEmpty()) {
		((GWTFolder) actualItem.getUserObject()).setHasChildren(false);
	} else {
		((GWTFolder) actualItem.getUserObject()).setHasChildren(true);
	}

	// Ads folders childs if exists
	for (Iterator<GWTFolder> it = result.iterator(); it.hasNext(); ) {
		GWTFolder folder = it.next();
		TreeItem folderItem = new TreeItem(folder.getName());
		folderItem.setUserObject(folder);
		folderItem.setStyleName("okm-TreeItem");

		// If has no childs directly add values is permited, else 
		// evalues each node to refresh, remove or add
		if (directAdd) {
			evaluesFolderIcon(folderItem);
			actualItem.addItem(folderItem);
		} else {
			// sequentially activate items and refreshes values
			addFolder(actualItem, folderItem);
		}
	}

	actualItem.setState(true);
	evaluesFolderIcon(actualItem);
	Main.get().mainPanel.desktop.navigator.thesaurusTree.thesaurusSelectPopup.thesaurusPanel.status.unsetFlagChilds();
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:42,代码来源:FolderSelectTree.java

示例7: onSuccess

import com.google.gwt.user.client.ui.TreeItem; //导入方法依赖的package包/类
public void onSuccess(List<GWTFolder> result) {
	boolean directAdd = true;

	// If has no childs directly add values is permited
	if (actualItem.getChildCount() > 0) {
		directAdd = false;
		// to prevent remote folder remove it disables all tree branch 
		// items and after sequentially activate
		hideAllBranch(actualItem);
	}

	// On refreshing not refreshed the actual item values but must 
	// ensure that has childs value is consistent
	if (result.isEmpty()) {
		((GWTFolder) actualItem.getUserObject()).setHasChildren(false);
	} else {
		((GWTFolder) actualItem.getUserObject()).setHasChildren(true);
	}

	// Ads folders childs if exists
	for (Iterator<GWTFolder> it = result.iterator(); it.hasNext(); ) {
		GWTFolder folder = it.next();
		TreeItem folderItem = new TreeItem(folder.getName());
		folderItem.setUserObject(folder);
		folderItem.setStyleName("okm-TreeItem");

		// If has no childs directly add values is permited, else 
		// evalues each node to refresh, remove or add
		if (directAdd) {
			evaluesFolderIcon(folderItem);
			actualItem.addItem(folderItem);
		} else {
			// sequentially activate items and refreshes values
			addFolder(actualItem, folderItem);
		}
	}

	actualItem.setState(true);
	evaluesFolderIcon(actualItem);
	Main.get().mainPanel.desktop.navigator.categoriesTree.categoriesSelectPopup.status.unsetFlagChilds();
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:42,代码来源:FolderSelectTree.java


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