Creates the view online entry, if an online link is available.<p>

@return the menu entry or null, if not available
180537
protected I_CmsContextMenuEntry createViewOnlineEntry() {

        final String onlineLink = m_controller.getData().getOnlineLink();
        CmsContextMenuEntry entry = null;
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(onlineLink)) {
            I_CmsContextMenuCommand command = new I_CmsContextMenuCommand() {

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

                    Window.open(onlineLink, "opencms-online", null);
                }

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

                    return null;
                }

                public boolean hasItemWidget() {

                    return false;
                }
            };
            entry = new CmsContextMenuEntry(this, null, command);
            CmsContextMenuEntryBean entryBean = new CmsContextMenuEntryBean();
            entryBean.setLabel(Messages.get().key(Messages.GUI_VIEW_ONLINE_0));
            entryBean.setActive(true);
            entryBean.setVisible(true);
            entry.setBean(entryBean);
        }
        return entry;
    }
416493
private CmsObject getOnlineCmsObject(CmsObject cms) {

        CmsObject res = null;
        try {
            res = OpenCms.initCmsObject(cms);
            res.getRequestContext().setCurrentProject(cms.readProject(CmsProject.ONLINE_PROJECT_ID));
        } catch (CmsException e) {
            LOG.error("Cannot create CmsObject", e);
        }
        return res;
    }
266780
private ComboBox createSiteSelect(CmsObject cms) {

        final IndexedContainer availableSites = CmsVaadinUtils.getAvailableSitesContainer(cms, SITE_CAPTION);
        ComboBox combo = new ComboBox(null, availableSites);
        combo.setTextInputAllowed(true);
        combo.setNullSelectionAllowed(false);
        combo.setWidth("200px");
        combo.setInputPrompt(
            Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_EXPLORER_CLICK_TO_EDIT_0));
        combo.setItemCaptionPropertyId(SITE_CAPTION);
        combo.select(cms.getRequestContext().getSiteRoot());
        combo.setFilteringMode(FilteringMode.CONTAINS);
        combo.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                String value = (String)event.getProperty().getValue();
                if (availableSites.containsId(value)) {
                    changeSite(value, null);
                    m_appContext.updateOnChange();
                    availableSites.removeAllContainerFilters();
                }
            }
        });
        if (Page.getCurrent().getBrowserWindowHeight() > 650) {
            combo.setPageLength(20);
        }
        return combo;
    }
407429
protected JComponent createViewToolBar() {
    	if(getPageComponent() instanceof AbstractEditor){
    		AbstractEditor editor = (AbstractEditor)getPageComponent();
            return editor.getEditorToolBar();
    	}
    	return null;
    }
790771
private CmsSitemapHoverbar getHoverbar() {

        for (Widget w : getListItemWidget().getContentPanel()) {
            if (!(w instanceof CmsSitemapHoverbar)) {
                continue;
            }
            return (CmsSitemapHoverbar)w;
        }
        return null;
    }
459048
public function menuLogin(): ?Menu
    {
        if (Auth::check()) {
            return null;
        }

        // Return to this page after login...
        $url = app(ServerRequestInterface::class)->getUri();

        // ...but switch from the tree-page to the user-page
        $url = str_replace('route=tree-page', 'route=user-page', $url);

        return new Menu(I18N::translate('Sign in'), route('login', ['url' => $url]), 'menu-login', ['rel' => 'nofollow']);
    }
802839
private void initUserMenu() {

        if (!m_user.isManaged()) {
            m_menu.addMenuEntry(
                CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_CHANGE_PASSWORD_BUTTON_0),
                null).addClickListener(new ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        m_context.start(
                            CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_PWCHANGE_HEADER_0)
                                + m_user.getSimpleName(),
                            new CmsChangePasswordDialog(m_context));
                    }
                });
        }
        final CmsPreferencesDialogAction preferencesAction = new CmsPreferencesDialogAction();
        m_menu.addMenuEntry(preferencesAction.getTitle(A_CmsUI.get().getLocale()), null).addClickListener(
            new ClickListener() {

                private static final long serialVersionUID = 1L;

                public void buttonClick(ClickEvent event) {

                    preferencesAction.executeAction(m_context);
                }
            });
        if (!m_user.isManaged()) {
            m_menu.addMenuEntry(CmsVaadinUtils.getMessageText(Messages.GUI_USER_EDIT_0), null).addClickListener(
                new Button.ClickListener() {

                    private static final long serialVersionUID = 1L;

                    public void buttonClick(ClickEvent event) {

                        editUserData();
                    }
                });
        }
        m_menu.addMenuEntry(
            CmsVaadinUtils.getMessageText(org.opencms.workplace.explorer.Messages.GUI_EXPLORER_CONTEXT_LOGOUT_0),
            null).addClickListener(new Button.ClickListener() {

                private static final long serialVersionUID = 1L;

                public void buttonClick(ClickEvent event) {

                    logout();
                }
            });
    }
915199
public MenuInflater getMenuInflater() {
        if (DEBUG) Log.d(TAG, "[getMenuInflater]");

        // Make sure that action views can get an appropriate theme.
        if (mMenuInflater == null) {
            if (getActionBar() != null) {
                mMenuInflater = new MenuInflater(getThemedContext(), mActivity);
            } else {
                mMenuInflater = new MenuInflater(mActivity);
            }
        }
        return mMenuInflater;
    }
847061
public CmsSelectBox createViewSelectorForGalleryDialog() {

        List<CmsElementViewInfo> elementViews = m_controller.getData().getElementViews();
        if (elementViews.size() <= 1) {
            return null;
        }
        CmsUUID currentView = m_controller.getElementView().getElementViewId();
        Map<String, String> options = Maps.newHashMap();
        for (CmsElementViewInfo view : elementViews) {
            options.put("" + view.getElementViewId(), view.getTitle());
        }
        CmsSelectBox result = new CmsSelectBox(options);
        result.setFormValueAsString(currentView.toString());
        result.addValueChangeHandler(new ValueChangeHandler<String>() {

            public void onValueChange(ValueChangeEvent<String> event) {

                m_editor.getAdd().setActive(false);
                CmsElementViewInfo newValue = m_controller.getView(event.getValue());
                setElementView(newValue, new Runnable() {

                    public void run() {

                        m_editor.getAdd().setActive(true);
                    }
                });
            }
        });
        result.getElement().getStyle().setWidth(250, Unit.PX);

        return result;
    }
332013
public String htmlSource() {
        try {
            return driver.getPageSource();
        } catch (Exception e) {
            log.warn(e);
            return null;
        }
    }
313398
public String getHtmlForDbSelection() {

        StringBuffer buf = new StringBuffer(2048);

        buf.append(
            "<select name=\"fullDatabaseKey\" style=\"width: 250px;\" size=\"1\" onchange=\"location.href='../../step_3_database_selection.jsp?fullDatabaseKey='+this.options[this.selectedIndex].value;\">");
        buf.append("<!-- --------------------- JSP CODE --------------------------- -->");

        // get all available databases
        List<String> databases = getSortedDatabases();

        //  List all databases found in the dbsetup.properties
        if ((databases != null) && (databases.size() > 0)) {

            List<String> sqlDbs = new ArrayList<String>();

            for (String dbKey : databases) {
                sqlDbs.add(dbKey);
            }

            // show the sql dbs first
            for (String dbKey : sqlDbs) {
                String dn = getDatabaseName(dbKey);
                String selected = "";
                if (getFullDatabaseKey().equals(dbKey + "_sql")) {
                    selected = "selected";
                }
                buf.append("<option value='" + dbKey + "_sql' " + selected + ">" + dn);
            }
        } else {
            buf.append("<option value='null'>no database found");
        }

        buf.append("<!-- --------------------------------------------------------- -->");
        buf.append("</select>");

        return buf.toString();
    }
280777
private ZapMenuItem getMenuFind() {
        if (menuFind == null) {
            menuFind = new ZapMenuItem("menu.edit.find", getFindDefaultKeyStroke());

            menuFind.addActionListener(new java.awt.event.ActionListener() {
                @Override
                public void actionPerformed(java.awt.event.ActionEvent e) {
                    showFindDialog(getView().getMainFrame(), null);
                }
            });
        }
        return menuFind;
    }
1024909
public boolean showOverflowMenu() {
        if (mReserveOverflow && !isOverflowMenuShowing() && mMenu != null && mMenuView != null &&
                mPostedOpenRunnable == null && !mMenu.getNonActionItems().isEmpty()) {
            OverflowPopup popup = new OverflowPopup(mContext, mMenu, mOverflowButton, true);
            mPostedOpenRunnable = new OpenOverflowRunnable(popup);
            // Post this for later; we might still need a layout for the anchor to be right.
            ((View) mMenuView).post(mPostedOpenRunnable);

            // ActionMenuPresenter uses null as a callback argument here
            // to indicate overflow is opening.
            super.onSubMenuSelected(null);

            return true;
        }
        return false;
    }
855607
protected I_CmsContextMenuEntry createToggleEditSmallElementsMenuEntry() {

        final CmsSmallElementsHandler smallElementsHandler = m_controller.getSmallElementsHandler();
        final boolean isActive = smallElementsHandler.areSmallElementsEditable();
        CmsContextMenuEntryBean entryBean = new CmsContextMenuEntryBean();
        String baseMessage = Messages.get().key(Messages.GUI_EDIT_SMALL_ELEMENTS_0);
        String msgEdit = baseMessage;
        String msgDisable = baseMessage;
        String label = isActive ? msgDisable : msgEdit;
        entryBean.setLabel(label);
        entryBean.setActive(smallElementsHandler.hasSmallElements());
        entryBean.setVisible(true);
        I_CmsInputCss inputCss = I_CmsInputLayoutBundle.INSTANCE.inputCss();
        entryBean.setIconClass(isActive ? inputCss.checkBoxImageChecked() : inputCss.checkBoxImageUnchecked());
        I_CmsContextMenuCommand command = new I_CmsContextMenuCommand() {

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

                smallElementsHandler.setEditSmallElements(!isActive, true);
            }

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

                return null;
            }

            public boolean hasItemWidget() {

                return false;
            }
        };
        CmsContextMenuEntry entry = new CmsContextMenuEntry(this, null, command);
        entry.setBean(entryBean);
        return entry;
    }
286912
List<I_CmsSimpleContextMenuEntry<Set<String>>> getMenuEntries() {

        if (m_menuEntries == null) {
            m_menuEntries = new ArrayList<I_CmsSimpleContextMenuEntry<Set<String>>>();
            m_menuEntries.add(new EntryResources());
            m_menuEntries.add(new EntryDelete());
        }
        return m_menuEntries;
    }
212685
private ZapMenuItem getMenuHelpAbout() {
		if (menuHelpAbout == null) {
			menuHelpAbout = new ZapMenuItem("menu.help.about");
			menuHelpAbout.addActionListener(new java.awt.event.ActionListener() { 
				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    
					AboutDialog dialog = new AboutDialog(View.getSingleton().getMainFrame(), true);
					dialog.setVisible(true);
				}
			});

		}
		return menuHelpAbout;
	}
42925
private List<CmsSelectWidgetOption> createNavOpts(CmsSiteBean currSite) {

        List<CmsSite> sites = new ArrayList<CmsSite>();
        for (CmsSite site : OpenCms.getSiteManager().getAvailableSites(getCms(), true)) {
            if (site.getSiteMatcher() != null) {
                sites.add(site);
            }
        }

        float maxValue = 0;
        float nextPos = 0;

        // calculate value for the first navigation position
        float firstValue = 1;
        if (sites.size() > 0) {
            try {
                maxValue = sites.get(0).getPosition();
            } catch (Exception e) {
                // should usually never happen
            }
        }

        if (maxValue != 0) {
            firstValue = maxValue / 2;
        }

        List<String> options = new ArrayList<String>(sites.size() + 1);
        List<String> values = new ArrayList<String>(sites.size() + 1);

        // add the first entry: before first element
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_FIRST_0));
        values.add(firstValue + "");

        // show all present navigation elements in box
        for (int i = 0; i < sites.size(); i++) {
            String navText = sites.get(i).getTitle();
            float navPos = sites.get(i).getPosition();
            String siteRoot = sites.get(i).getSiteRoot();
            // get position of next nav element
            nextPos = navPos + 2;
            if ((i + 1) < sites.size()) {
                nextPos = sites.get(i + 1).getPosition();
            }
            // calculate new position of current nav element
            float newPos;
            if ((nextPos - navPos) > 1) {
                newPos = navPos + 1;
            } else {
                newPos = (navPos + nextPos) / 2;
            }
            // check new maxValue of positions and increase it
            if (navPos > maxValue) {
                maxValue = navPos;
            }
            // if the element is the current file, mark it in select box
            if ((currSite != null) && (currSite.getSiteRoot() != null) && currSite.getSiteRoot().equals(siteRoot)) {
                options.add(
                    CmsEncoder.escapeHtml(
                        getMessages().key(
                            org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_CURRENT_1,
                            new Object[] {sites.get(i).getSiteRoot()})));
                values.add("-1");
            } else {
                options.add(CmsEncoder.escapeHtml(navText + " [" + sites.get(i).getSiteRoot() + "/]"));
                values.add(newPos + "");
            }
        }

        // add the entry: at the last position
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_POS_LAST_0));
        values.add((maxValue + 1) + "");

        // add the entry: no change
        options.add(getMessages().key(org.opencms.workplace.commons.Messages.GUI_CHNAV_NO_CHANGE_0));
        if ((currSite != null) && (currSite.getPosition() == Float.MAX_VALUE)) {
            // current resource has no valid position, use "last position"
            values.add((maxValue + 1) + "");
        } else {
            // current resource has valid position, use "-1" for no change
            values.add("-1");
        }
        List<CmsSelectWidgetOption> result = new ArrayList<CmsSelectWidgetOption>();
        for (int i = 0; i < values.size(); i++) {
            String val = values.get(i);
            String opt = options.get(i);
            result.add(new CmsSelectWidgetOption(val, false, opt));
        }
        return result;
    }