Java Code Examples for com.google.gwt.user.client.ui.TreeItem#setStyleName()
The following examples show how to use
com.google.gwt.user.client.ui.TreeItem#setStyleName() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FolderTree.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * 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(); } }
Example 2
Source File: FolderTree.java From document-management-system with GNU General Public License v2.0 | 5 votes |
@Override 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(); newFolder.setHTML(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; }
Example 3
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override 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(); folderItem.setHTML(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); }
Example 4
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override 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(); folderItem.setHTML(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); }
Example 5
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override 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(); folderItem.setHTML(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); }
Example 6
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override 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(); folderItem.setHTML(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); }
Example 7
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override 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(); folderItem.setHTML(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(); }
Example 8
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override 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(); folderItem.setHTML(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(); }
Example 9
Source File: FolderSelectTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override 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(); folderItem.setHTML(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); }
Example 10
Source File: FolderTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override public void onSuccess(List<GWTFolder> result) { List<GWTFolder> folderList = result; autoOpenFolder = actualItem.getState(); // Actual folder open state // Case first refreshing when (childcount = 0 or treeItem changed ) and results >0 must ensure enables auto open if ((actualItem.getChildCount() == 0 || treeItemChanged) && result.size() > 0) { autoOpenFolder = true; } // Remove all items if (actualItem.getChildCount() > 0) { actualItem.removeItems(); } // On refreshing not refreshed the actual item values but must // ensure that has childs value is consistent if (folderList.isEmpty()) { ((GWTFolder) actualItem.getUserObject()).setHasChildren(false); } else { ((GWTFolder) actualItem.getUserObject()).setHasChildren(true); } // Ads folders childs if exists for (Iterator<GWTFolder> it = folderList.iterator(); it.hasNext(); ) { GWTFolder folder = it.next(); TreeItem folderItem = new TreeItem(); folderItem.setHTML(folder.getName()); folderItem.setUserObject(folder); folderItem.setStyleName("okm-TreeItem"); // add values evaluesFolderIcon(folderItem); actualItem.addItem(folderItem); } // Evaluates special case has closed parent folder ( and selected folder was a child ) if (!treeItemHasBeenClosed) { actualItem.setState(autoOpenFolder); // Enables auto open or close tree node } else { treeItemHasBeenClosed = false; } evaluesFolderIcon(actualItem); if (setTabFolderAfterRefresh) { // Refresh tab properties values on the last node showTabFolderProperties(); setTabFolderAfterRefresh = false; } Main.get().mainPanel.desktop.navigator.status.unsetFlagChilds(); }
Example 11
Source File: FolderTree.java From document-management-system with GNU General Public License v2.0 | 4 votes |
@Override public void onSuccess(List<GWTFolder> result) { List<GWTFolder> folderList = result; // Remove olders items if (actualItem.getChildCount() > 0) { actualItem.removeItems(); } // On refreshing not refreshed the actual item values but must // ensure that has childs value is consistent if (folderList.isEmpty()) { ((GWTFolder) actualItem.getUserObject()).setHasChildren(false); } else { ((GWTFolder) actualItem.getUserObject()).setHasChildren(true); } // Ads folders childs if exists for (Iterator<GWTFolder> it = folderList.iterator(); it.hasNext(); ) { GWTFolder folder = it.next(); TreeItem folderItem = new TreeItem(); folderItem.setHTML(folder.getName()); folderItem.setUserObject(folder); folderItem.setStyleName("okm-TreeItem"); // add values evaluesFolderIcon(folderItem); actualItem.addItem(folderItem); } actualItem.setState(true); evaluesFolderIcon(actualItem); if (!tmpAllPathFolder.isEmpty()) { int index = tmpAllPathFolder.size() - 1; String tmpPath = tmpAllPathFolder.get(index); tmpAllPathFolder.remove(index); if (index > 0) { setActiveNode(tmpPath, false, false); } else { setActiveNode(tmpPath, false, refreshFileBrowser); } } else { openingFldPath = false; } }