Creates a list item.<p>

@param containerElement the element data

@return the list item widget
509291
public CmsMenuListItem createListItem(final CmsContainerElementData containerElement) {

        CmsMenuListItem listItem = new CmsMenuListItem(containerElement);
        if (!containerElement.isGroupContainer()
            && !containerElement.isInheritContainer()
            && CmsStringUtil.isEmptyOrWhitespaceOnly(containerElement.getNoEditReason())) {
            listItem.enableEdit(new ClickHandler() {

                public void onClick(ClickEvent event) {

                    CmsEditableData editableData = new CmsEditableData();
                    editableData.setElementLanguage(CmsCoreProvider.get().getLocale());
                    editableData.setStructureId(
                        new CmsUUID(CmsContainerpageController.getServerId(containerElement.getClientId())));
                    editableData.setSitePath(containerElement.getSitePath());
                    getController().getContentEditorHandler().openDialog(editableData, false, null, null, null);
                    ((CmsPushButton)event.getSource()).clearHoverState();
                }
            });
        } else {
            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(containerElement.getNoEditReason())) {
                listItem.disableEdit(containerElement.getNoEditReason(), true);
            } else {
                listItem.disableEdit(Messages.get().key(Messages.GUI_CLIPBOARD_ITEM_CAN_NOT_BE_EDITED_0), false);
            }
        }
        String clientId = containerElement.getClientId();
        String serverId = CmsContainerpageController.getServerId(clientId);
        if (CmsUUID.isValidUUID(serverId)) {
            CmsContextMenuButton button = new CmsContextMenuButton(new CmsUUID(serverId), new CmsContextMenuHandler() {

                @Override
                public void refreshResource(CmsUUID structureId) {

                    Window.Location.reload();
                }
            }, AdeContext.gallery);
            listItem.getListItemWidget().addButtonToFront(button);
        }
        listItem.initMoveHandle(m_controller.getDndHandler(), true);
        return listItem;
    }
363964
protected void breakUpContainer() {

        List<String> clientIds = new ArrayList<String>();
        for (Widget w : getGroupContainerWidget()) {
            if (w instanceof CmsContainerPageElementPanel) {
                CmsContainerPageElementPanel elementWidget = (CmsContainerPageElementPanel)w;
                if ((elementWidget.getInheritanceInfo() == null) || elementWidget.getInheritanceInfo().isVisible()) {
                    clientIds.add(elementWidget.getId());
                }
            }
        }
        int index = getIndexPosition();
        for (String clientId : clientIds) {
            try {
                CmsContainerElementData elementData = getController().getCachedElement(clientId);
                CmsContainerPageElementPanel containerElement = getController().getContainerpageUtil().createElement(
                    elementData,
                    getParentContainer(),
                    false);
                getParentContainer().insert(containerElement, index);
                index++;
            } catch (Exception e) {
                CmsDebugLog.getInstance().printLine(e.getMessage());
            }
        }
        getController().addToRecentList(getGroupContainerWidget().getId(), null);
        getController().unlockResource(
            new CmsUUID(CmsContainerpageController.getServerId(m_elementData.getClientId())));
        closeDialog(true);
        getController().setPageChanged();
    }
411803
CmsContainerElementBean getElementForEditHandler(DialogContext context) {

        List<Item> selected = context.getSelectedItems();
        if (selected.size() == 1) {
            Item item = selected.get(0);
            Date instanceDate = (Date)item.getItemProperty(INSTANCEDATE_PROPERTY).getValue();
            CmsResource resource = context.getResources().get(0);
            return new CmsContainerElementBean(
                resource.getStructureId(),
                null,
                Collections.singletonMap(
                    CmsDateSeriesEditHandler.PARAM_INSTANCEDATE,
                    String.valueOf(instanceDate.getTime())),
                false);
        }
        return null;
    }
211872
protected List<CmsDialogElement> getElementList() {

        if (m_elementList == null) {
            m_elementList = CmsDialogElements.computeElements(getCms(), m_page, getParamTempfile(), getElementLocale());
        }
        return m_elementList;
    }
812029
private static CmsListItemWidget generateItemWidget(final CmsClientSitemapEntry entry) {

        CmsListInfoBean infoBean = getInfoBean(entry, true);
        final CmsListItemWidget itemWidget = new CmsListItemWidget(infoBean);
        itemWidget.setUnselectable();
        itemWidget.setIcon(CmsSitemapView.getInstance().getIconForEntry(entry));
        itemWidget.setTopRightIcon(null, "");
        itemWidget.setIconTitle(
            entry.isSubSitemapType()
            ? Messages.get().key(Messages.GUI_HOVERBAR_GOTO_SUB_0)
            : Messages.get().key(Messages.GUI_HOVERBAR_GOTO_0));
        setAdditionalStyles(entry, itemWidget);
        return itemWidget;
    }
1050740
protected List<Element> select(String selector, Element context) {

        NodeList<Element> elements = CmsDomUtil.querySelectorAll(selector, context);
        List<Element> result = new ArrayList<Element>();
        for (int i = 0; i < elements.getLength(); i++) {
            result.add(elements.getItem(i));
        }
        return result;
    }
15683
private CmsContainerBean buildContainerBean(ContainerInfo cnt) {

        List<CmsContainerElementBean> elements = Lists.newArrayList();
        for (CmsResource resource : cnt.getResources()) {
            CmsContainerElementBean elementBean = buildContainerElementBean(cnt, resource);
            elements.add(elementBean);
        }
        CmsContainerBean result = new CmsContainerBean(cnt.getName(), cnt.getType(), null, true, elements);
        return result;
    }
94605
public static List<CmsContainerElementBean> getInheritedContainerElements(
        CmsObject cms,
        CmsContainerElementBean element) {

        CmsResource resource = element.getResource();
        return CmsXmlInheritGroupContainerHandler.loadInheritContainerElements(cms, resource);
    }
544384
public String getContentByContainer(CmsFile elementFile, String elementId, CmsContainer container) {

        CmsContainerElementBean element = CmsADESessionCache.getCache(m_req, m_cms).getCacheContainerElement(elementId);
        element = element.clone();
        element.setTemporaryFile(elementFile);
        CmsFormatterConfiguration configs = getFormatterConfiguration(element.getResource());
        return getContentByContainer(element, container, configs);
    }
1296336
private Map<String, String> getContentsByContainerName(
        CmsContainerElementBean element,
        Collection<CmsContainer> containers) {

        CmsFormatterConfiguration configs = getFormatterConfiguration(element.getResource());
        Map<String, String> result = new HashMap<String, String>();
        for (CmsContainer container : containers) {
            String content = getContentByContainer(element, container, configs);
            if (content != null) {
                content = removeScriptTags(content);
            }
            result.put(container.getName(), content);
        }
        return result;
    }
1255643
public CmsElementOptionButton createOptionForElement(CmsContainerPageElementPanel element) {

        if (!isOptionAvailable(element)) {
            return null;
        }
        CmsElementOptionButton button = new CmsElementOptionButton(this, element);
        button.addClickHandler(m_elementClickHandler);
        return button;
    }
1283494
@NonNull
    private ListDialog.OnItemSelectedListener createItemSelectedListener() {
        return new ListDialog.OnItemSelectedListener() {

            @Override
            public void onItemSelected(final int position) {
                ColorPalettePreference.this.selectedIndex = position;
                ColorPalettePreference.this.onClick(getDialog(), DialogInterface.BUTTON_POSITIVE);

                if (getDialog() != null) {
                    getDialog().dismiss();
                }
            }

        };
    }
580437
public static List<CmsContainerElementBean> loadInheritContainerElements(CmsObject cms, CmsResource resource) {

        CmsInheritanceReferenceParser parser = new CmsInheritanceReferenceParser(cms);
        try {
            parser.parse(resource);
            CmsInheritanceReference ref = parser.getReference(cms.getRequestContext().getLocale());
            if (ref != null) {
                String name = ref.getName();
                CmsADEManager adeManager = OpenCms.getADEManager();
                CmsInheritedContainerState result = adeManager.getInheritedContainerState(
                    cms,
                    cms.getRequestContext().getRootUri(),
                    name);
                return result.getElements(false);
            }
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
        return Collections.emptyList();
    }
814638
protected CmsListItem makeListItem(CmsUser user) {

        CmsListItem item = getList().newItem(user.getId().toString());
        setUserData(user, item);
        return item;
    }
705299
private CmsElementOptionBar createOptionBar(CmsContainerPageElementPanel elementWidget) {

        CmsElementOptionBar optionBar = new CmsElementOptionBar(elementWidget);
        CmsPushButton button = new CmsRemoveOptionButton(elementWidget, this);
        button.addClickHandler(m_optionClickHandler);
        optionBar.add(button);

        button = new CmsFavoritesOptionButton(elementWidget, this);
        button.addClickHandler(m_optionClickHandler);
        optionBar.add(button);

        button = new CmsSettingsOptionButton(elementWidget, this);
        button.addClickHandler(m_optionClickHandler);
        optionBar.add(button);

        button = new CmsInfoOptionButton(elementWidget, this);
        button.addClickHandler(m_optionClickHandler);
        optionBar.add(button);

        button = new CmsAddOptionButton(elementWidget, this);
        button.addClickHandler(m_optionClickHandler);
        optionBar.add(button);

        button = new CmsInheritedOptionButton(elementWidget, this);
        optionBar.add(button);

        button = new CmsMoveOptionButton(elementWidget, this);
        // setting the drag and drop handler
        button.addMouseDownHandler(getController().getDndHandler());
        optionBar.add(button);

        button = new CmsEditOptionButton(elementWidget, this);
        button.addClickHandler(m_optionClickHandler);
        optionBar.add(button);

        return optionBar;
    }
177978
protected I_CmsFormatterBean getElementFormatter(CmsContainerElementBean element) {

        if (m_elementInstances == null) {
            initPageData();
        }
        I_CmsFormatterBean formatter = null;
        CmsContainerBean container = m_parentContainers.get(element.getInstanceId());
        if (container == null) {
            // use the current container
            container = getContainer();
        }
        if (container != null) {
            String containerName = container.getName();
            Map<String, String> settings = element.getSettings();
            if (settings != null) {
                String formatterConfigId = settings.get(CmsFormatterConfig.getSettingsKeyForContainer(containerName));
                if (CmsUUID.isValidUUID(formatterConfigId)) {
                    formatter = OpenCms.getADEManager().getCachedFormatters(false).getFormatters().get(
                        new CmsUUID(formatterConfigId));
                }
            }
            if (formatter == null) {
                try {
                    CmsResource resource = m_cms.readResource(m_cms.getRequestContext().getUri());

                    CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(
                        m_cms,
                        resource.getRootPath());
                    CmsFormatterConfiguration formatters = config.getFormatters(m_cms, resource);
                    int width = -2;
                    try {
                        width = Integer.parseInt(container.getWidth());
                    } catch (Exception e) {
                        LOG.debug(e.getLocalizedMessage(), e);
                    }
                    formatter = formatters.getDefaultSchemaFormatter(container.getType(), width);
                } catch (CmsException e1) {
                    if (LOG.isWarnEnabled()) {
                        LOG.warn(e1.getLocalizedMessage(), e1);
                    }
                }
            }
        }
        return formatter;
    }
1253295
public static CmsElementOptionBar createOptionBarForElement(
        CmsContainerPageElementPanel element,
        CmsDNDHandler dndHandler,
        A_CmsToolbarOptionButton... buttons) {

        CmsElementOptionBar optionBar = new CmsElementOptionBar(element);
        if (buttons != null) {
            // add buttons, last as first
            for (int i = buttons.length - 1; i >= 0; i--) {
                CmsElementOptionButton option = buttons[i].createOptionForElement(element);
                if (option == null) {
                    continue;
                }
                optionBar.add(option);
                if (buttons[i] instanceof CmsToolbarMoveButton) {
                    option.addMouseDownHandler(dndHandler);
                }
            }
        }
        return optionBar;
    }