Opens the next available root element view.<p>
767708
private void openNextElementView() {

        List<CmsElementViewInfo> views = getData().getElementViews();
        if (views.size() > 1) {
            CmsUUID current = m_elementView.getRootViewId();

            // look for the current view index
            int currentIndex = -1;
            for (int i = 0; i < views.size(); i++) {
                CmsElementViewInfo view = views.get(i);
                if (view.isRoot() && current.equals(view.getElementViewId())) {
                    currentIndex = i;
                    break;
                }
            }
            if (currentIndex != -1) {
                CmsElementViewInfo target = null;
                // look for the next root view
                for (int i = currentIndex + 1; i < views.size(); i++) {
                    CmsElementViewInfo view = views.get(i);
                    if (view.isRoot()) {
                        target = view;
                        break;
                    }
                }
                if (target == null) {
                    // start at the beginning
                    for (int i = 0; i < currentIndex; i++) {
                        CmsElementViewInfo view = views.get(i);
                        if (view.isRoot()) {
                            target = view;
                            break;
                        }
                    }
                }
                if (target != null) {
                    final String viewName = target.getTitle();
                    Runnable action = new Runnable() {

                        public void run() {

                            CmsNotification.get().send(
                                Type.NORMAL,
                                Messages.get().key(Messages.GUI_SWITCH_ELEMENT_VIEW_NOTIFICATION_1, viewName));
                        }
                    };
                    setElementView(target, action);
                }
            }
        }
    }
940067
private void adaptRootView() {
        if (rootView != null) {
            if (getStyle() == Style.LIST) {
                int paddingTop = getContext().getResources()
                        .getDimensionPixelSize(R.dimen.bottom_sheet_list_padding_top);
                rootView.setPadding(0, paddingTop, 0, 0);
            } else {
                int paddingTop = getContext().getResources()
                        .getDimensionPixelSize(R.dimen.bottom_sheet_grid_padding_top);
                rootView.setPadding(0, paddingTop, 0, 0);
            }
        }
    }
358260
protected I_CmsContextMenuEntry createElementViewSelectionMenuEntry() {

        List<CmsElementViewInfo> elementViews = m_controller.getData().getElementViews();
        if (elementViews.size() > 1) {
            CmsContextMenuEntry parentEntry = new CmsContextMenuEntry(this, null, new I_CmsContextMenuCommand() {

                public void execute(
                    CmsUUID innerStructureId,
                    I_CmsContextMenuHandler handler,
                    CmsContextMenuEntryBean bean) {

                    // do nothing
                }

                public A_CmsContextMenuItem getItemWidget(
                    CmsUUID innerStructureId,
                    I_CmsContextMenuHandler handler,
                    CmsContextMenuEntryBean bean) {

                    return null;
                }

                public boolean hasItemWidget() {

                    return false;
                }

            });
            CmsContextMenuEntryBean parentBean = new CmsContextMenuEntryBean();

            parentBean.setLabel(Messages.get().key(Messages.GUI_SELECT_ELEMENT_VIEW_0));
            parentBean.setActive(true);
            parentBean.setVisible(true);
            parentEntry.setBean(parentBean);
            List<I_CmsContextMenuEntry> viewEntries = new ArrayList<I_CmsContextMenuEntry>();
            for (CmsElementViewInfo viewInfo : elementViews) {
                if (viewInfo.isRoot()) {
                    viewEntries.add(
                        createMenuEntryForElementView(
                            viewInfo,
                            m_controller.matchRootView(viewInfo.getElementViewId()),
                            this));
                }
            }

            parentEntry.setSubMenu(viewEntries);
            return parentEntry;
        } else {
            return null;
        }
    }
829969
public void open(Element sourceElement) {
        this.sourceElement = sourceElement;
        $("body").attr("style", "overflow: hidden !important");
        animator.setSourceElement(sourceElement);
        animator.setTargetElement(getElement());
        animator.setCompletedCallback(() -> OpenEvent.fire(MaterialOverlay.this, MaterialOverlay.this));
        animator.animate();
    }
926966
private View createView(LayoutInflater inflater, @Nullable View headerView, boolean fixedHeader,
                          @Nullable View footerView, boolean fixedFooter, BaseAdapter adapter) {
    View view = holder.getView(inflater, rootView);

    if (holder instanceof ViewHolder) {
      assignClickListenerRecursively(view);
    }

    if (headerView != null) {
      assignClickListenerRecursively(headerView);
      holder.addHeader(headerView, fixedHeader);
    }

    if (footerView != null) {
      assignClickListenerRecursively(footerView);
      holder.addFooter(footerView, fixedFooter);
    }

    if (adapter != null && holder instanceof HolderAdapter) {
      HolderAdapter holderAdapter = (HolderAdapter) holder;
      holderAdapter.setAdapter(adapter);
      holderAdapter.setOnItemClickListener(new OnHolderListener() {
        @Override public void onItemClick(@NonNull Object item, @NonNull View view, int position) {
          if (onItemClickListener == null) {
            return;
          }
          onItemClickListener.onItemClick(DialogPlus.this, item, view, position);
        }
      });
    }
    return view;
  }
204266
private void initFolderTree(boolean showInvisible) throws CmsException {

        CmsObject cms = A_CmsUI.getCmsObject();
        m_treeContainer.removeAllItems();
        try {
            CmsResource siteRoot = cms.readResource("/", FOLDERS);
            addTreeItem(cms, siteRoot, null, false, m_treeContainer);
        } catch (CmsException e) {
            if (showInvisible) {
                CmsResource siteRoot = cms.readResource("/", CmsResourceFilter.IGNORE_EXPIRATION);
                addTreeItem(cms, siteRoot, null, true, m_treeContainer);
            } else {
                throw e;
            }
        }

    }
632542
protected Map<CmsUUID, CmsElementView> loadElementViews() {

        List<CmsElementView> views = new ArrayList<CmsElementView>();
        if (m_cms.existsResource("/")) {
            views.add(CmsElementView.DEFAULT_ELEMENT_VIEW);
            try {
                @SuppressWarnings("deprecation")
                CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(
                    m_elementViewType.getTypeId());
                List<CmsResource> groups = m_cms.readResources("/", filter);
                for (CmsResource res : groups) {
                    try {
                        views.add(new CmsElementView(m_cms, res));
                    } catch (Exception e) {
                        LOG.error(e.getMessage(), e);
                    }
                }
            } catch (CmsException e) {
                LOG.error(e.getLocalizedMessage(), e);
            }
            Collections.sort(views, new CmsElementView.ElementViewComparator());
            Map<CmsUUID, CmsElementView> elementViews = new LinkedHashMap<CmsUUID, CmsElementView>();
            for (CmsElementView view : views) {
                elementViews.put(view.getId(), view);
            }
            return elementViews;
        }
        return null;
    }
925247
private void navigateToFragment() {

        String fragment = getPage().getUriFragment();
        if (fragment != null) {
            getNavigator().navigateTo(fragment);
        } else {
            CmsObject cms = getCmsObject();
            String target = CmsLoginHelper.getStartView(cms);
            if (target != null) {
                if (target.startsWith("#")) {
                    getNavigator().navigateTo(target.substring(1));
                } else {
                    Page.getCurrent().setLocation(OpenCms.getLinkManager().substituteLink(cms, target));
                }
            } else {
                showHome();
            }
        }
    }
317221
public void updateOptionBarPosition() {

        // only if attached to the DOM
        if ((m_elementOptionBar != null) && RootPanel.getBodyElement().isOrHasChild(getElement())) {
            int absoluteTop = getElement().getAbsoluteTop();
            int absoluteRight = getElement().getAbsoluteRight();
            CmsPositionBean dimensions = CmsPositionBean.getBoundingClientRect(getElement());

            int top = 0;
            int right = 0;
            int offsetLeft = 0;
            int offsetTop = 0;

            final Style style = m_elementOptionBar.getElement().getStyle();

            if (m_positioningInstructionParser.tryParse(getElement().getClassName())) {
                offsetLeft = m_positioningInstructionParser.getOffsetLeft();
                offsetTop = m_positioningInstructionParser.getOffsetTop();
            }

            if (Math.abs(absoluteTop - dimensions.getTop()) > 20) {
                absoluteTop = (dimensions.getTop() - absoluteTop) + 2;
                top = absoluteTop;
            }
            if (Math.abs(absoluteRight - dimensions.getLeft() - dimensions.getWidth()) > 20) {
                absoluteRight = (absoluteRight - dimensions.getLeft() - dimensions.getWidth()) + 2;
                right = absoluteRight;
            }

            top += offsetTop;
            right -= offsetLeft;

            if (top != 0) {
                style.setTop(top, Unit.PX);
            } else {
                style.clearTop();
            }

            if (right != 0) {
                style.setRight(right, Unit.PX);
            } else {
                style.clearRight();
            }

            if (isOptionbarIFrameCollision(absoluteTop, m_elementOptionBar.getCalculatedWidth())) {
                style.setPosition(Position.RELATIVE);
                int marginLeft = getElement().getClientWidth() - m_elementOptionBar.getCalculatedWidth();
                if (marginLeft > 0) {
                    style.setMarginLeft(marginLeft, Unit.PX);
                }
            } else {
                style.clearPosition();
                style.clearMarginLeft();
            }
        }
    }
5237
public void openFirstLevel() {

        if (!m_categories.isEmpty()) {
            for (int i = 0; i < m_scrollList.getWidgetCount(); i++) {
                CmsTreeItem item = (CmsTreeItem)m_scrollList.getItem(i);
                item.setOpen(true);
            }
        }
    }
710463
public void open() {
        if (!isAttached()) {
            RootPanel.get().add(this);
        }
        windowCount++;
        if(windowOverlay != null && !windowOverlay.isAttached()) {
            RootPanel.get().add(windowOverlay);
        }

        if (fullsceenOnMobile && Window.matchMedia(Resolution.ALL_MOBILE.asMediaQuery())) {
            setMaximize(true);
        }

        if (openAnimation == null) {
            getOpenMixin().setOn(true);
            OpenEvent.fire(this, true);
        } else {
            setOpacity(0);
            Scheduler.get().scheduleDeferred(() -> {
                getOpenMixin().setOn(true);
                openAnimation.animate(this, () -> OpenEvent.fire(this, true));
            });
        }
    }
1148909
public void traverse(Object root) {
    // Reset the state
    visited.clear();
    toVisit.clear();

    if (root == null) return;

    addIfNotVisited(root, root.getClass());
    start();
  }
1327327
protected void openFileSelector() {

        try {

            final Window window = CmsBasicDialog.prepareWindow(DialogWidth.max);
            window.setCaption(m_fileSelectCaption != null ? m_fileSelectCaption : getWindowCaption());
            A_CmsUI.get().addWindow(window);
            CmsResourceSelectDialog fileSelect;

            //Switch if cms object was set.
            if (m_cms == null) {
                fileSelect = new CmsResourceSelectDialog(m_filter, A_CmsUI.getCmsObject(), getOptions());
            } else {
                fileSelect = new CmsResourceSelectDialog(m_filter, m_cms, getOptions());
            }
            if (m_diableSiteSwitch) {
                fileSelect.disableSiteSwitch();
            }
            fileSelect.showSitemapView(m_startWithSitemapView);

            T value = getValue();
            if (value instanceof CmsResource) {
                fileSelect.showStartResource((CmsResource)value);
            } else if (value instanceof String) {
                if (CmsStringUtil.isEmptyOrWhitespaceOnly((String)value)) {
                    fileSelect.openPath(m_defaultPath);
                } else {
                    fileSelect.openPath((String)value);
                }
            }

            window.setContent(fileSelect);
            fileSelect.addSelectionHandler(new I_CmsSelectionHandler<CmsResource>() {

                public void onSelection(CmsResource selected) {

                    if (!resourceIsValid(selected)) {
                        return;
                    }
                    setResourceValue(selected);
                    window.close();

                }
            });
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
            CmsErrorDialog.showErrorDialog(e);
        }
    }
990461
protected void openPopup() {

        if (m_cmsPopup == null) {

            m_cmsPopup = new CmsPopup(Messages.get().key(Messages.GUI_DIALOG_CATEGORIES_TITLE_0), CmsPopup.WIDE_WIDTH);
            m_cmsCategoryTree = new CmsCategoryTree(m_selected, 300, m_isSingleValue, m_resultList, m_collapsed);
            m_cmsPopup.add(m_cmsCategoryTree);
            m_cmsPopup.setModal(false);
            m_cmsPopup.setAutoHideEnabled(true);
            m_cmsPopup.addCloseHandler(new CloseHandler<PopupPanel>() {

                public void onClose(CloseEvent<PopupPanel> event) {

                    closePopup();

                }
            });
            m_cmsPopup.addDialogClose(new Command() {

                public void execute() {

                    // do nothing all will done in onClose();
                }
            });
        }
        if (m_previewHandlerRegistration != null) {
            m_previewHandlerRegistration.removeHandler();
        }
        m_previewHandlerRegistration = Event.addNativePreviewHandler(new CloseEventPreviewHandler());
        m_cmsCategoryTree.truncate("CATEGORIES", CmsPopup.WIDE_WIDTH - 20);
        m_cmsPopup.showRelativeTo(m_categoryField);
        m_xcoordspopup = m_cmsPopup.getPopupLeft();
        m_ycoordspopup = m_cmsPopup.getPopupTop();
    }
1178813
public void showLoginView(String preselectedOu) {

        VerticalLayout content = new VerticalLayout();
        content.setSizeFull();

        m_targetOpener = new CmsLoginTargetOpener(A_CmsUI.get());
        //content.setExpandRatio(m_targetOpener, 0f);
        content.addComponent(m_loginForm);
        content.setComponentAlignment(m_loginForm, Alignment.MIDDLE_CENTER);
        content.setExpandRatio(m_loginForm, 1);

        setContent(content);
        if (preselectedOu == null) {
            preselectedOu = "/";
        }
        m_loginForm.selectOrgUnit(preselectedOu);

    }
802425
public static void showPreviewForResource(CmsPreviewInfo previewInfo) {

        if (previewInfo.isNewWindowRequired()) {
            CmsDomUtil.openWindow(previewInfo.getPreviewUrl(), CmsDomUtil.Target.BLANK.getRepresentation(), "");
        } else {

            CmsPreviewDialog dialog = createPreviewDialog(previewInfo);
            dialog.center();
        }
    }
146341
protected void updateRoot(CmsObject rootCms, CmsResource siteRootResource) {

        m_root = siteRootResource;
        m_currentCms = rootCms;
        updateView();
    }