Adds new item to context menu root with given caption.<p>

@param caption the caption
@return reference to newly added item
19065
public ContextMenuItem addItem(String caption) {

        ContextMenuItemState itemState = getState().addChild(caption, getNextId());

        ContextMenuItem item = new ContextMenuItem(null, itemState);
        m_items.put(itemState.getId(), item);

        return item;
    }
169088
public static ScmOperationContextBuilder builder(ScmOperationContext context) {
        ScmOperationContextBuilder builder = new ScmOperationContextBuilder();
        builder.impl = new ScmOperationContextImpl(context);
        return builder;
    }
46678
public Position add( Position position ) {
        if (this.getIndexInContent() < 0) {
            return position.getIndexInContent() < 0 ? EMPTY_CONTENT_POSITION : position;
        }

        if (position.getIndexInContent() < 0) {
            return this;
        }

        int index = this.getIndexInContent() + position.getIndexInContent();
        int line = position.getLine() + this.getLine() - 1;
        int column = this.getLine() == 1 ? this.getColumn() + position.getColumn() : this.getColumn();

        return new Position(index, line, column);
    }
69922
public ParagraphBuilder span(final String text) {
		final ParagraphElement paragraphElement = new Span(text);
		this.paragraphElements.add(paragraphElement);
		return this;
	}
491702
@Override
   public void addToContainer(Element container, Element element) throws DocumentException, VectorPrintException {
      if (container instanceof TextElementArray) {
         if (element instanceof Image) {
            ((TextElementArray) container).add(new Chunk((Image) element, 0, 0, true));
         } else {
            ((TextElementArray) container).add(element);
         }
      } else if (container instanceof PdfPTable) {
         if (element instanceof PdfPCell) {
            ((PdfPTable) container).addCell((PdfPCell) element);
         } else if (element instanceof Phrase) {
            ((PdfPTable) container).addCell((Phrase) element);
         } else if (element instanceof PdfPTable) {
            ((PdfPTable) container).addCell((PdfPTable) element);
         } else if (element instanceof Image) {
            ((PdfPTable) container).addCell((Image) element);
         } else {
            throw new VectorPrintException(String.format("don't know how to add %s to %s", (element == null) ? "null" : element.getClass().getName(), (container == null) ? "null" : container.getClass().getName()));
         }
      } else if (container instanceof PdfPCell) {
         if (element instanceof PdfPTable) {
            throw new VectorPrintException(String.format("use %s.%s if you want to nest tables", CONTAINER_ELEMENT.class.getName(), CONTAINER_ELEMENT.NESTED_TABLE));
         }
         ((PdfPCell) container).addElement(element);
      } else if (container instanceof ColumnText) {
         ((ColumnText) container).addElement(element);
      } else {
         throw new VectorPrintException(String.format("don't know how to add %s to %s", (element == null) ? "null" : element.getClass().getName(), (container == null) ? "null" : container.getClass().getName()));
      }
   }
300429
public BusCommandContext newCommandContext(Endpoint endpoint) {
        return new BusCommandContext(endpoint, connectionFactoryProvider.getConnectionFactory(),
                wsEndpoints.getUiClientSessions(), wsEndpoints.getFeedSessions());
    }
1361188
public function setCaption($caption): Table
    {
        $this->caption = $caption;
        $this->options['caption']['value'] = $caption;

        return $this;
    }
424418
private IndexedContainer getStartViewContainer(String caption) {

        List<I_CmsWorkplaceAppConfiguration> apps = OpenCms.getWorkplaceAppManager().getDefaultQuickLaunchConfigurations();

        IndexedContainer res = new IndexedContainer();

        res.addContainerProperty(caption, String.class, "");

        for (I_CmsWorkplaceAppConfiguration app : apps) {
            if (hasRoleForApp(app)) {
                Item item = res.addItem(app.getId());
                item.getItemProperty(caption).setValue(app.getName(A_CmsUI.get().getLocale()));
            }
        }
        return res;
    }
1346121
public function addFieldButton($caption,$visibleHover=true,$callback=null){
		$this->addField($this->getCallable("getFieldButton",[$caption,$visibleHover],$callback));
		return $this;
	}
94591
public void add(CmsAccessControlEntry entry) {

        CmsPermissionSetCustom p = m_permissions.get(entry.getPrincipal());
        if (p == null) {
            p = new CmsPermissionSetCustom();
            m_permissions.put(entry.getPrincipal(), p);
        }
        p.addPermissions(entry.getPermissions());
    }
164959
public ContextMenuItemState addChild(String itemCaption, String itemId) {

        ContextMenuItemState rootItem = new ContextMenuItemState();
        rootItem.setCaption(itemCaption);
        rootItem.setId(itemId);

        m_rootItems.add(rootItem);

        return rootItem;
    }
1016647
public void loadContextMenu(final CmsUUID structureId, final AdeContext context) {

        /** The RPC menu action for the container page dialog. */
        CmsRpcAction<List<CmsContextMenuEntryBean>> menuAction = new CmsRpcAction<List<CmsContextMenuEntryBean>>() {

            /**
            * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
            */
            @Override
            public void execute() {

                getCoreService().getContextMenuEntries(structureId, context, this);
            }

            /**
            * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
            */
            @Override
            public void onResponse(List<CmsContextMenuEntryBean> menuBeans) {

                m_handler.insertContextMenu(menuBeans, structureId);
            }
        };
        menuAction.execute();

    }
81658
public static IndexedContainer buildContainerFromMap(String captionProperty, Map<String, String> map) {

        IndexedContainer container = new IndexedContainer();
        for (Map.Entry<String, String> entry : map.entrySet()) {
            container.addItem(entry.getKey()).getItemProperty(captionProperty).setValue(entry.getValue());
        }
        return container;
    }
795468
private CmsContextMenuItemWidget createEmptyItemWidget(
        String id,
        String caption,
        String description,
        CmsContextMenuConnector contextMenuConnector) {

        CmsContextMenuItemWidget widget = GWT.create(CmsContextMenuItemWidget.class);
        widget.setId(id);
        widget.setCaption(caption);
        widget.setTitle(description);
        widget.setIcon(contextMenuConnector.getConnection().getIcon(contextMenuConnector.getResourceUrl(id)));

        CmsContextMenuItemWidgetHandler handler = new CmsContextMenuItemWidgetHandler(widget, contextMenuConnector);
        widget.addClickHandler(handler);
        widget.addMouseOutHandler(handler);
        widget.addMouseOverHandler(handler);
        widget.addKeyUpHandler(handler);
        widget.setRootComponent(this);

        return widget;
    }
1327204
private void addNewPropertyButton(final CmsPropertyTable table) {

        Button add = CmsToolBar.createButton(
            FontOpenCms.WAND,
            CmsVaadinUtils.getMessageText(Messages.GUI_DATABASEAPP_PROPERTY_NEW_CAPTION_0));
        add.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 1L;

            public void buttonClick(ClickEvent event) {

                final Window window = CmsBasicDialog.prepareWindow();
                window.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_DATABASEAPP_PROPERTY_NEW_CAPTION_0));
                window.setContent(new CmsAddPropertyDefinitionDialog(window, table));
                A_CmsUI.get().addWindow(window);
            }
        });
        m_uiContext.addToolbarButton(add);

    }
45090
public CMASpaceMembership addRole(CMALink role) {
    if (role == null) {
      throw new IllegalArgumentException("Role cannot be null!");
    }

    if (roles == null) {
      roles = new ArrayList<CMALink>();
    }

    this.roles.add(role);
    return this;
  }
1351090
private void initContextMenu() {

        m_contextMenu.removeItems();
        MenuItem main = m_contextMenu.addItem("", null);
        main.setIcon(FontOpenCms.CONTEXT_MENU);
        main.setDescription(CmsVaadinUtils.getMessageText(Messages.GUI_MENU_TITLE_0));
        CmsContextMenuTreeBuilder treeBuilder = new CmsContextMenuTreeBuilder(getDialogContext());
        CmsTreeNode<I_CmsContextMenuItem> tree = treeBuilder.buildAll(
            OpenCms.getWorkplaceAppManager().getMenuItemProvider().getMenuItems());
        for (CmsTreeNode<I_CmsContextMenuItem> node : tree.getChildren()) {
            createMenuEntry(main, node, treeBuilder);
        }
    }