private void initToolbar() {

        m_toolbar = new CmsToolbar();
        m_toolbar.setAppTitle(Messages.get().key(Messages.GUI_CONTENT_EDITOR_TITLE_0));
        m_publishButton = createButton(
            I_CmsButton.ButtonData.PUBLISH_BUTTON.getTitle(),
            I_CmsButton.ButtonData.PUBLISH_BUTTON.getIconClass());
        m_toolbar.addLeft(m_publishButton);
        m_publishButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                boolean unlock = shouldUnlockAutomatically();

                saveAndDeleteEntities(unlock, new I_CmsSimpleCallback<Boolean>() {

                    public void execute(final Boolean hasChangedSeetings) {

                        setSaved();
                        HashMap<String, String> params = new HashMap<String, String>(
                            getContext().getPublishParameters());
                        CmsUUID structureId = CmsContentDefinition.entityIdToUuid(getEntityId());
                        params.put(CmsPublishOptions.PARAM_CONTENT, "" + structureId);
                        params.put(CmsPublishOptions.PARAM_START_WITH_CURRENT_PAGE, "");
                        CmsPublishDialog.showPublishDialog(params, new CloseHandler<PopupPanel>() {

                            public void onClose(CloseEvent<PopupPanel> closeEvent) {

                                if (m_onClose != null) {
                                    m_onClose.execute(
                                        Boolean.valueOf(m_hasChangedSettings || hasChangedSeetings.booleanValue()));
                                }
                                clearEditor();
                            }
                        }, new Runnable() {

                            public void run() {

                                // ignore
                            }

                        }, null);

                    }
                });

            }
        });
        m_saveExitButton = createButton(
            Messages.get().key(Messages.GUI_TOOLBAR_SAVE_AND_EXIT_0),
            "opencms-icon-save-exit");
        m_saveExitButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                deferSaveAndExit();
            }
        });
        m_toolbar.addLeft(m_saveExitButton);
        m_saveButton = createButton(
            Messages.get().key(Messages.GUI_TOOLBAR_SAVE_0),
            I_CmsButton.ButtonData.SAVE_BUTTON.getIconClass());
        m_saveButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                deferSave();
            }
        });
        m_saveButton.setVisible(false);
        m_toolbar.addLeft(m_saveButton);
        disableSave(Messages.get().key(Messages.GUI_TOOLBAR_NOTHING_CHANGED_0));
        m_undoButton = createButton(Messages.get().key(Messages.GUI_TOOLBAR_UNDO_0), "opencms-icon-undo");
        m_undoButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                if (CmsUndoRedoHandler.getInstance().isIntitalized()) {
                    CmsUndoRedoHandler.getInstance().undo();
                }
            }
        });
        m_undoButton.disable(Messages.get().key(Messages.GUI_TOOLBAR_UNDO_DISABLED_0));
        m_undoButton.setVisible(false);
        m_toolbar.addLeft(m_undoButton);
        m_redoButton = createButton(Messages.get().key(Messages.GUI_TOOLBAR_REDO_0), "opencms-icon-redo");
        m_redoButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                if (CmsUndoRedoHandler.getInstance().isIntitalized()) {
                    CmsUndoRedoHandler.getInstance().redo();
                }
            }
        });
        m_redoButton.disable(Messages.get().key(Messages.GUI_TOOLBAR_REDO_DISABLED_0));
        m_redoButton.setVisible(false);
        m_toolbar.addLeft(m_redoButton);

        m_undoRedoHandlerRegistration = CmsUndoRedoHandler.getInstance().addValueChangeHandler(
            new ValueChangeHandler<CmsUndoRedoHandler.UndoRedoState>() {

                public void onValueChange(ValueChangeEvent<UndoRedoState> event) {

                    setUndoRedoState(event.getValue());
                }
            });
        m_openFormButton = createButton(
            Messages.get().key(Messages.GUI_TOOLBAR_OPEN_FORM_0),
            I_CmsButton.ButtonData.EDIT.getIconClass());
        m_openFormButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                initFormPanel();
                renderFormContent();
            }
        });
        m_toolbar.addLeft(m_openFormButton);

        m_hideHelpBubblesButton = new CmsToggleButton();

        m_hideHelpBubblesButton.setImageClass(I_CmsButton.ButtonData.TOGGLE_HELP.getIconClass());
        m_hideHelpBubblesButton.setButtonStyle(ButtonStyle.FONT_ICON, null);
        m_hideHelpBubblesButton.setSize(Size.big);
        m_hideHelpBubblesButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                CmsToggleButton button = (CmsToggleButton)event.getSource();
                hideHelpBubbles(!button.isDown());
            }
        });
        m_hideHelpBubblesButton.setDown(CmsCoreProvider.get().isShowEditorHelp());
        CmsValueFocusHandler.getInstance().hideHelpBubbles(RootPanel.get(), !CmsCoreProvider.get().isShowEditorHelp());
        if (!CmsCoreProvider.get().isShowEditorHelp()) {
            m_hideHelpBubblesButton.setTitle(Messages.get().key(Messages.GUI_TOOLBAR_HELP_BUBBLES_HIDDEN_0));
        } else {
            m_hideHelpBubblesButton.setTitle(Messages.get().key(Messages.GUI_TOOLBAR_HELP_BUBBLES_SHOWN_0));
        }
        m_toolbar.addRight(m_hideHelpBubblesButton);

        m_cancelButton = createButton(
            Messages.get().key(Messages.GUI_TOOLBAR_RESET_0),
            I_CmsButton.ButtonData.RESET_BUTTON.getIconClass());
        m_cancelButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {

                confirmCancel();
            }
        });
        m_toolbar.addRight(m_cancelButton);
        RootPanel.get().add(m_toolbar);
    }
private void initToolbar ( ) { m_toolbar = new CmsToolbar ( ) ; m_toolbar . setAppTitle ( Messages . get ( ) . key ( Messages . GUI_CONTENT_EDITOR_TITLE_0 ) ) ; m_publishButton = createButton ( I_CmsButton . ButtonData . PUBLISH_BUTTON . getTitle ( ) , I_CmsButton . ButtonData . PUBLISH_BUTTON . getIconClass ( ) ) ; m_toolbar . addLeft ( m_publishButton ) ; m_publishButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { boolean unlock = shouldUnlockAutomatically ( ) ; saveAndDeleteEntities ( unlock , new I_CmsSimpleCallback < Boolean > ( ) { public void execute ( final Boolean hasChangedSeetings ) { setSaved ( ) ; HashMap < String , String > params = new HashMap < String , String > ( getContext ( ) . getPublishParameters ( ) ) ; CmsUUID structureId = CmsContentDefinition . entityIdToUuid ( getEntityId ( ) ) ; params . put ( CmsPublishOptions . PARAM_CONTENT , "" + structureId ) ; params . put ( CmsPublishOptions . PARAM_START_WITH_CURRENT_PAGE , "" ) ; CmsPublishDialog . showPublishDialog ( params , new CloseHandler < PopupPanel > ( ) { public void onClose ( CloseEvent < PopupPanel > closeEvent ) { if ( m_onClose != null ) { m_onClose . execute ( Boolean . valueOf ( m_hasChangedSettings || hasChangedSeetings . booleanValue ( ) ) ) ; } clearEditor ( ) ; } } , new Runnable ( ) { public void run ( ) { } } , null ) ; } } ) ; } } ) ; m_saveExitButton = createButton ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_SAVE_AND_EXIT_0 ) , "opencms-icon-save-exit" ) ; m_saveExitButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { deferSaveAndExit ( ) ; } } ) ; m_toolbar . addLeft ( m_saveExitButton ) ; m_saveButton = createButton ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_SAVE_0 ) , I_CmsButton . ButtonData . SAVE_BUTTON . getIconClass ( ) ) ; m_saveButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { deferSave ( ) ; } } ) ; m_saveButton . setVisible ( false ) ; m_toolbar . addLeft ( m_saveButton ) ; disableSave ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_NOTHING_CHANGED_0 ) ) ; m_undoButton = createButton ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_UNDO_0 ) , "opencms-icon-undo" ) ; m_undoButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { if ( CmsUndoRedoHandler . getInstance ( ) . isIntitalized ( ) ) { CmsUndoRedoHandler . getInstance ( ) . undo ( ) ; } } } ) ; m_undoButton . disable ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_UNDO_DISABLED_0 ) ) ; m_undoButton . setVisible ( false ) ; m_toolbar . addLeft ( m_undoButton ) ; m_redoButton = createButton ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_REDO_0 ) , "opencms-icon-redo" ) ; m_redoButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { if ( CmsUndoRedoHandler . getInstance ( ) . isIntitalized ( ) ) { CmsUndoRedoHandler . getInstance ( ) . redo ( ) ; } } } ) ; m_redoButton . disable ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_REDO_DISABLED_0 ) ) ; m_redoButton . setVisible ( false ) ; m_toolbar . addLeft ( m_redoButton ) ; m_undoRedoHandlerRegistration = CmsUndoRedoHandler . getInstance ( ) . addValueChangeHandler ( new ValueChangeHandler < CmsUndoRedoHandler . UndoRedoState > ( ) { public void onValueChange ( ValueChangeEvent < UndoRedoState > event ) { setUndoRedoState ( event . getValue ( ) ) ; } } ) ; m_openFormButton = createButton ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_OPEN_FORM_0 ) , I_CmsButton . ButtonData . EDIT . getIconClass ( ) ) ; m_openFormButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { initFormPanel ( ) ; renderFormContent ( ) ; } } ) ; m_toolbar . addLeft ( m_openFormButton ) ; m_hideHelpBubblesButton = new CmsToggleButton ( ) ; m_hideHelpBubblesButton . setImageClass ( I_CmsButton . ButtonData . TOGGLE_HELP . getIconClass ( ) ) ; m_hideHelpBubblesButton . setButtonStyle ( ButtonStyle . FONT_ICON , null ) ; m_hideHelpBubblesButton . setSize ( Size . big ) ; m_hideHelpBubblesButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { CmsToggleButton button = ( CmsToggleButton ) event . getSource ( ) ; hideHelpBubbles ( ! button . isDown ( ) ) ; } } ) ; m_hideHelpBubblesButton . setDown ( CmsCoreProvider . get ( ) . isShowEditorHelp ( ) ) ; CmsValueFocusHandler . getInstance ( ) . hideHelpBubbles ( RootPanel . get ( ) , ! CmsCoreProvider . get ( ) . isShowEditorHelp ( ) ) ; if ( ! CmsCoreProvider . get ( ) . isShowEditorHelp ( ) ) { m_hideHelpBubblesButton . setTitle ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_HELP_BUBBLES_HIDDEN_0 ) ) ; } else { m_hideHelpBubblesButton . setTitle ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_HELP_BUBBLES_SHOWN_0 ) ) ; } m_toolbar . addRight ( m_hideHelpBubblesButton ) ; m_cancelButton = createButton ( Messages . get ( ) . key ( Messages . GUI_TOOLBAR_RESET_0 ) , I_CmsButton . ButtonData . RESET_BUTTON . getIconClass ( ) ) ; m_cancelButton . addClickHandler ( new ClickHandler ( ) { public void onClick ( ClickEvent event ) { confirmCancel ( ) ; } } ) ; m_toolbar . addRight ( m_cancelButton ) ; RootPanel . get ( ) . add ( m_toolbar ) ; }
Generates the button bar displayed beneath the editable fields.<p>