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