Installs a hover bar for the given item widget.<p>

@param controller the controller
@param treeItem the item to hover
@param buttons the buttons

@return the hover bar instance
978310
public static CmsSitemapHoverbar installOn(
        CmsSitemapController controller,
        CmsTreeItem treeItem,
        Collection<Widget> buttons) {

        CmsSitemapHoverbar hoverbar = new CmsSitemapHoverbar(controller, buttons);
        installHoverbar(hoverbar, treeItem.getListItemWidget());
        return hoverbar;
    }
332556
def __insert_child(self, parent_tree_node, index, tree_node):
        
        # manage the item model
        parent_item = self.__mapping[id(parent_tree_node)]
        self.item_model_controller.begin_insert(index, index, parent_item.row, parent_item.id)
        properties = {
            "display": self.__display_for_tree_node(tree_node),
            "tree_node": tree_node  # used for removal and other lookup
        }
        item = self.item_model_controller.create_item(properties)
        parent_item.insert_child(index, item)
        self.__mapping[id(tree_node)] = item
        self.item_model_controller.end_insert()
856837
public void addToolbarButtons(ToolScreen toolScreen)
    {
        new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, "Delete All", MenuConstants.DELETE, "Delete All", null);
    }
920532
public void addToolbarButtons(ToolScreen toolScreen)
    {
        super.addToolbarButtons(toolScreen);
        ResourceBundle resources = ((BaseApplication)this.getTask().getApplication()).getResources(ResourceConstants.PROGRAM_RESOURCE, true);
        new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, resources.getString(ClassProject.CLASS_DETAIL_SCREEN), MenuConstants.DISTRIBUTION, ClassProject.CLASS_DETAIL_SCREEN, resources.getString(ClassProject.CLASS_DETAIL_SCREEN));
        new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, resources.getString(ClassProject.RESOURCE_DETAIL_SCREEN), MenuConstants.GROUP, ClassProject.RESOURCE_DETAIL_SCREEN, resources.getString(ClassProject.RESOURCE_DETAIL_SCREEN));
    }
863849
private void createButtonBar() {
		// Update and reset controls for the repeater.
		WPanel buttonPanel = new WPanel(WPanel.Type.FEATURE);
		buttonPanel.setMargin(new Margin(Size.MEDIUM, null , Size.LARGE, null));
		buttonPanel.setLayout(new BorderLayout());

		WButton updateButton = new WButton("Update");
		updateButton.setImage("/image/document-save-5.png");
		updateButton.setImagePosition(WButton.ImagePosition.EAST);
		buttonPanel.add(updateButton, BorderLayout.EAST);

		WButton resetButton = new WButton("Reset");
		resetButton.setImage("/image/edit-undo-8.png");
		resetButton.setImagePosition(WButton.ImagePosition.WEST);
		resetButton.setAction(new Action() {
			@Override
			public void execute(final ActionEvent event) {
				repeater.setData(fetchDataList());
			}
		});
		buttonPanel.add(resetButton, BorderLayout.WEST);
		add(buttonPanel);
		add(new WAjaxControl(updateButton, repeater));
		add(new WAjaxControl(resetButton, repeater));
	}
1025814
public void addToolbarButtons(ToolScreen toolScreen)
    {
        new SCannedBox(toolScreen.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.SET_ANCHOR), toolScreen, null, ScreenConstants.DEFAULT_DISPLAY, null, ScriptScreen.GO, ScriptScreen.GO, ScriptScreen.GO, null);
    }
315168
function (element, options) {
    this.element = element;
    this.options = options;

    $(this.element).addClass(ClassName.tree);

    $(Selector.treeview + Selector.active, this.element).addClass(ClassName.open);

    this._setUpListeners();
  }
847307
function generateSidebar(statusMap, nextPipelineId, rootElement) {
  var currentElement = null;

  if (nextPipelineId) {
    currentElement = $('<li>');
    // Value should match return of getTreePipelineElementId
    currentElement.attr('id', 'item-pipeline-' + nextPipelineId);
  } else {
    currentElement = rootElement;
    nextPipelineId = statusMap.rootPipelineId;
  }

  var parentInfoMap = statusMap.pipelines[nextPipelineId];
  currentElement.append(
      constructStageNode(nextPipelineId, parentInfoMap, true));

  if (statusMap.pipelines[nextPipelineId]) {
    var children = statusMap.pipelines[nextPipelineId].children;
    if (children.length > 0) {
      var treeElement = null;
      if (rootElement) {
        treeElement =
            $('<ul id="pipeline-tree" class="treeview-black treeview">');
      } else {
        treeElement = $('<ul>');
      }

      $.each(children, function(index, childPipelineId) {
        var childElement = generateSidebar(statusMap, childPipelineId);
        treeElement.append(childElement);
      });
      currentElement.append(treeElement);
    }
  }
  return currentElement;
}
1265244
protected void initTree(CmsResource rootRes) throws CmsException {

        m_currentRoot = rootRes;
        m_treeContainer.removeAllComponents();
        showHeader();
        CmsSitemapTreeController controller = new CmsSitemapTreeController(
            A_CmsUI.getCmsObject(),
            rootRes,
            this,
            m_treeContainer);

        // no need to escape a structure id
        JavaScript.eval(CmsGwtConstants.VAR_LOCALE_ROOT + "='" + rootRes.getStructureId() + "'");

        CmsSitemapUI ui = (CmsSitemapUI)(A_CmsUI.get());
        ui.getSitemapExtension().setSitemapTreeController(controller);
        CmsSitemapTreeNode root1 = controller.createRootNode();
        controller.initEventHandlers(root1);
        m_treeContainer.addComponent(root1);
        controller.onClickOpen(root1);
    }
896776
function Toolbar() {
		var buttons = {};

		/*jslint unparam: true*//* allow the unused param title until Toolbar rewrite*/
		function add(id, text, title, fn) {
			if (!buttons[id]) {
				var button = renderer.text(
					text,
					0,
					0
				)
				.css(options.toolbar.itemStyle)
				.align({
					align: 'right',
					x: -marginRight - 20,
					y: plotTop + 30
				})
				.on('click', fn)
				/*.on('touchstart', function(e) {
					e.stopPropagation(); // don't fire the container event
					fn();
				})*/
				.attr({
					align: 'right',
					zIndex: 20
				})
				.add();
				buttons[id] = button;
			}
		}
		/*jslint unparam: false*/

		function remove(id) {
			discardElement(buttons[id].element);
			buttons[id] = null;
		}

		// public
		return {
			add: add,
			remove: remove
		};
	}
756466
function(parent, name, nested, populateFunction, icon, tooltip, selectionClass, positioningNode, defaultInvocation, pretendDefaultActionId, extraClasses) {
			parent = lib.node(parent);
			// We create dropdowns asynchronously so it's possible that the parent has been removed from the document 
			// by the time we are called.  If so, don't bother building a submenu for an orphaned menu.
			if (!parent || !lib.contains(document.body, parent)) {
				return null;
			}
			var menuButton, newMenu, dropdownArrow;
			var destroyButton, menuParent = parent;
			if (nested) {
				var range = document.createRange();
				range.selectNode(parent);
				var buttonFragment = range.createContextualFragment(SubMenuButtonFragment);
				// bind name to fragment variable
				lib.processTextNodes(buttonFragment, {ButtonText: name});
				parent.appendChild(buttonFragment);
				destroyButton = parent.lastChild;
				newMenu = destroyButton.lastChild;
				menuButton = newMenu.previousSibling;
				menuButton.dropdown = new mDropdown.Dropdown({dropdown: newMenu, name: name, populate: populateFunction, parentDropdown: parent.dropdown});
				newMenu.dropdown = menuButton.dropdown;
			} else {
				if (parent.nodeName.toLowerCase() === "ul") { //$NON-NLS-0$
					menuParent = document.createElement("li"); //$NON-NLS-0$
					menuParent.setAttribute("role", "none");
					parent.appendChild(menuParent);
					destroyButton = menuParent;
				}
				var buttonCss = null;
				if (icon) {
					buttonCss = "dropdownButtonWithIcon"; //$NON-NLS-0$ // This class distinguishes dropdown buttons with an icon from those without
					tooltip = tooltip || name; // No text and no tooltip => fallback to name
				}
				tooltip = icon ? (tooltip || name) : tooltip;
				var created = Commands.createDropdownMenu(menuParent, name, populateFunction, buttonCss, icon, false, selectionClass, positioningNode, defaultInvocation || pretendDefaultActionId, extraClasses);
				dropdownArrow = created.dropdownArrow;
				menuButton = created.menuButton;
				if (dropdownArrow) {
					if (defaultInvocation) {
						defaultInvocation.domNode = created.menuButton;
					}
					var self = this;
					menuButton.onclick = function(evt){
						var bounds = lib.bounds(dropdownArrow);
						if ((evt.clientX >= bounds.left || pretendDefaultActionId === true) && created.dropdown) {
							created.dropdown.toggle(evt);
						} else {
							self._invoke(defaultInvocation);
						}
					};
					if (created.dropdown) {
						menuButton.onkeydown = function(evt) {
							if (lib.KEY.DOWN === evt.keyCode) {
								created.dropdown.toggle(evt);
								lib.stop(evt);
							}
						};
					}
				}
				newMenu = created.menu;
				var tooltipText, hasDefault = defaultInvocation && defaultInvocation.command && (defaultInvocation.command.tooltip || defaultInvocation.command.name);
				if (hasDefault) {
					tooltipText = defaultInvocation.command.tooltip || defaultInvocation.command.name;
				} else {
					tooltipText = tooltip;
				}
				if (tooltipText) {
					menuButton.commandTooltip = new mTooltip.Tooltip({
						node: menuButton,
						text: tooltipText,
						position: ["above", "below", "right", "left"] //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-0$
					});					
				}
			}
			
			return {menuButton: menuButton, menu: newMenu, dropdown: menuButton.dropdown, destroyButton: destroyButton, dropdownArrow: dropdownArrow};
		}
625728
public void addOptionBar(CmsContainerPageElementPanel element) {

        // the view permission is required for any actions regarding this element
        if (element.hasViewPermission()) {
            CmsElementOptionBar optionBar = CmsElementOptionBar.createOptionBarForElement(
                element,
                m_controller.getDndHandler(),
                m_optionButtons);
            element.setElementOptionBar(optionBar);
        }
    }
1369480
public void setController(@Nullable DraweeController draweeController) {
    mDraweeHolder.setController(draweeController);
    super.setImageDrawable(mDraweeHolder.getTopLevelDrawable());
  }
1098550
private void mapTreeHierarchy(final WComponent currentComponent,
			final StringTreeNode currentNode, final WText selectedMenuText) {
		if (currentNode.isLeaf()) {
			WMenuItem menuItem = new WMenuItem(currentNode.getData(), new ExampleMenuAction(
					selectedMenuText));
			menuItem.setActionObject(currentNode.getData());
			if (currentComponent instanceof WMenu) {
				((WMenu) currentComponent).add(menuItem);
			} else {
				((WSubMenu) currentComponent).add(menuItem);
			}
		} else {
			WSubMenu subMenu = new WSubMenu(currentNode.getData());
			subMenu.setSelectMode(SelectMode.SINGLE);

			if (currentComponent instanceof WMenu) {
				((WMenu) currentComponent).add(subMenu);
			} else {
				((WSubMenu) currentComponent).add(subMenu);
			}

			// Expand the first couple of levels in the tree by default.
			if (currentNode.getLevel() < 2) {
				subMenu.setOpen(true);
			}

			for (Iterator<TreeNode> i = currentNode.children(); i.hasNext();) {
				mapTreeHierarchy(subMenu, (StringTreeNode) i.next(), selectedMenuText);
			}
		}
	}
759702
public CmsSitemapTreeItem create(CmsClientSitemapEntry entry) {

        CmsSitemapTreeItem treeItem = new CmsSitemapTreeItem(entry);
        CmsSitemapHoverbar.installOn(m_controller, treeItem, entry.getId());
        // highlight the open path
        if (isLastPage(entry)) {
            treeItem.setBackgroundColor(Background.YELLOW);
        }
        m_treeItems.put(entry.getId(), treeItem);
        return treeItem;
    }
1096638
@Override
    public final void createPartControl(Composite parent) {
        root = createRootControl(parent);
        makeActions();
        hookContextMenu();
        hookDoubleClickAction();
        contributeToActionBars();
    }
164415
private void setButtonBarVisibility(Widget buttonBar, boolean visible) {

        String hoverStyle = I_CmsLayoutBundle.INSTANCE.form().hoverButton();
        if (visible) {
            buttonBar.addStyleName(hoverStyle);
        } else {
            buttonBar.removeStyleName(hoverStyle);
        }
        if (buttonBar instanceof CmsInlineEntityWidget) {
            ((CmsInlineEntityWidget)buttonBar).setContentHighlightingVisible(visible);
        }
        if (buttonBar.getParent() instanceof CmsInlineEntityWidget) {
            ((CmsInlineEntityWidget)buttonBar.getParent()).setContentHighlightingVisible(visible);
        }
    }