Opens the group container edit dialog.<p>

@param dialogTitle the dialog title
543266
protected void openDialog(String dialogTitle) {

        m_editorDialog.setCaption(dialogTitle);
        int contentHeight = m_dialogContent.getOffsetHeight();
        m_editorDialog.setMainContent(m_dialogContent);
        // position dialog and show it
        if (m_groupContainerPosition != null) {
            int lefthandSpace = m_groupContainerPosition.getLeft() - Window.getScrollLeft();
            int righthandSpace = (Window.getClientWidth() + Window.getScrollLeft())
                - (m_groupContainerPosition.getLeft() + m_groupContainerPosition.getWidth());
            int requiredWidth = CmsPopup.DEFAULT_WIDTH + 30;
            int left = m_groupContainerPosition.getLeft();
            if (requiredWidth > (righthandSpace + m_groupContainerPosition.getWidth())) {
                left = (Window.getClientWidth() + Window.getScrollLeft()) - requiredWidth;
            }
            if (left < Window.getScrollLeft()) {
                left = 0;
            }
            if (lefthandSpace > requiredWidth) {
                // place left of the group container if there is enough space
                m_editorDialog.setPopupPosition(
                    m_groupContainerPosition.getLeft() - requiredWidth,
                    m_groupContainerPosition.getTop() - 1);
            } else if ((m_groupContainerPosition.getTop() - Window.getScrollTop()) > (contentHeight
                + DIALOG_BASE_HEIGHT
                + 50)) {
                // else place above if there is enough space

                m_editorDialog.setPopupPosition(
                    left,
                    m_groupContainerPosition.getTop() - (contentHeight + DIALOG_BASE_HEIGHT));
            } else if (righthandSpace > requiredWidth) {
                // else on the right if there is enough space
                m_editorDialog.setPopupPosition(
                    m_groupContainerPosition.getLeft() + m_groupContainerPosition.getWidth() + 20,
                    m_groupContainerPosition.getTop() - 1);
            } else {
                // last resort, place below
                m_editorDialog.setPopupPosition(
                    left,
                    m_groupContainerPosition.getTop() + m_groupContainerPosition.getHeight() + 20);
            }
            m_editorDialog.show();
        } else {
            // should never happen
            m_editorDialog.center();
        }
        if (!m_controller.getData().isUseClassicEditor()) {
            for (Widget element : m_groupContainer) {
                if (element instanceof CmsContainerPageElementPanel) {
                    ((CmsContainerPageElementPanel)element).initInlineEditor(m_controller);
                }
            }
        }
    }
1187714
protected void editTitle() {

        m_title.setVisible(false);
        final TextBox box = new TextBox();
        box.setText(m_title.getText());
        box.getElement().setAttribute("size", "45");
        box.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().labelInput());
        box.addStyleName(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().titleInput());
        final String originalTitle = m_title.getText();
        // wrap the boolean flag in an array so we can change it from the event handlers
        final boolean[] checked = new boolean[] {false};
        final boolean restoreUnselectable = CmsDomUtil.hasClass(
            I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().unselectable(),
            m_contentPanel.getElement());
        m_contentPanel.removeStyleName(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().unselectable());
        box.addBlurHandler(new BlurHandler() {

            /**
             * @see com.google.gwt.event.dom.client.BlurHandler#onBlur(com.google.gwt.event.dom.client.BlurEvent)
             */
            public void onBlur(BlurEvent event) {

                if (restoreUnselectable) {
                    setUnselectable();
                }
                if (checked[0]) {
                    return;
                }

                onEditTitleTextBox(box);
                checked[0] = true;
            }
        });

        box.addKeyPressHandler(new KeyPressHandler() {

            /**
             * @see com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent)
             */
            public void onKeyPress(KeyPressEvent event) {

                if (checked[0]) {
                    return;
                }

                int keycode = event.getNativeEvent().getKeyCode();

                if ((keycode == 10) || (keycode == 13)) {
                    onEditTitleTextBox(box);
                    checked[0] = true;
                }
                if (keycode == 27) {
                    box.setText(originalTitle);
                    onEditTitleTextBox(box);
                    checked[0] = true;

                }
            }
        });
        m_titleBox.insert(box, 2);
        box.setFocus(true);
    }
274216
public void setContentEditing(boolean isContentEditing) {

        if (m_groupEditor != null) {
            if (isContentEditing) {
                m_groupEditor.hidePopup();
            } else {
                m_groupEditor.showPopup();
            }
        }
        m_isContentEditing = isContentEditing;
    }
725702
public void title(String title) {
        Validate.notNull(title);
        Element titleEl = getElementsByTag("title").first();
        if (titleEl == null) { // add to head
            head().appendElement("title").text(title);
        } else {
            titleEl.text(title);
        }
    }
634208
@Override
	public void setTitle(String title) {
		buttonAction.setTitle(title);
		titleLabel.setContents(prepareTitle());
	}
435334
protected void openDialog(CmsBasicDialog dialog, String windowCaption) {

        if (m_dialogWindow != null) {
            m_dialogWindow.close();
        }

        m_dialogWindow = CmsBasicDialog.prepareWindow(DialogWidth.wide);
        m_dialogWindow.setContent(dialog);
        m_dialogWindow.setCaption(windowCaption);

        A_CmsUI.get().addWindow(m_dialogWindow);
        m_dialogWindow.center();
    }
199009
public final void setTitle(final String title) {
        if (SwingUtilities.isEventDispatchThread()) {
            setTitleIntern(title);
        } else {
            try {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        setTitleIntern(title);
                    }
                });
            } catch (final Exception ex) {
                ignore();
            }
        }
    }
1001736
public static CmsPopup showFrameDialog(
        String title,
        String dialogUri,
        Map<String, String> parameters,
        CloseHandler<PopupPanel> closeHandler) {

        CmsPopup popup = new CmsPopup(title);
        popup.removePadding();
        popup.addStyleName(I_CmsLayoutBundle.INSTANCE.contentEditorCss().contentEditor());
        popup.setGlassEnabled(true);
        CmsIFrame editorFrame = new CmsIFrame(IFRAME_NAME, "");
        popup.add(editorFrame);
        final FormElement formElement = CmsDomUtil.generateHiddenForm(dialogUri, Method.post, IFRAME_NAME, parameters);
        RootPanel.getBodyElement().appendChild(formElement);
        exportDialogFunctions(popup);
        popup.addCloseHandler(new CloseHandler<PopupPanel>() {

            public void onClose(CloseEvent<PopupPanel> event) {

                formElement.removeFromParent();
                removeExportedFunctions();
            }
        });
        if (closeHandler != null) {
            popup.addCloseHandler(closeHandler);
        }
        popup.center();
        formElement.submit();
        return popup;
    }
267034
public void openDialog(String dialogId, String contextType, List<CmsUUID> resources) {

        openDialog(dialogId, contextType, resources, null);
    }
694371
public static VisDialog showOKDialog (Stage stage, String title, String text) {
		final VisDialog dialog = new VisDialog(title);
		dialog.closeOnEscape();
		dialog.text(text);
		dialog.button(ButtonType.OK.getText()).padBottom(3);
		dialog.pack();
		dialog.centerWindow();
		dialog.addListener(new InputListener() {
			@Override
			public boolean keyDown (InputEvent event, int keycode) {
				if (keycode == Keys.ENTER) {
					dialog.fadeOut();
					return true;
				}
				return false;
			}
		});
		stage.addActor(dialog.fadeIn());
		return dialog;
	}
849634
private void initializeEditTextDialog() {
        EditTextDialog.Builder builder =
                new EditTextDialog.Builder(getActivity()).setHint(R.string.edit_text_dialog_hint)
                        .setText(getContext().getString(R.string.edit_text_dialog_text))
                        .addValidator(Validators.notEmpty(getContext()));
        configureHeaderDialogBuilder(builder);
        configureButtonBarDialogBuilder(builder);
        editTextDialog = builder.create();
    }
848844
void internalOpenDialog(
        final CmsContainerPageElementPanel element,
        String editContentId,
        final boolean inline,
        boolean wasNew) {

        if (!m_editorOpened) {
            m_editorOpened = true;
            m_handler.disableToolbarButtons();
            m_handler.deactivateCurrentButton();
            m_currentElementId = editContentId;
            final String serverId = CmsContainerpageController.getServerId(m_currentElementId);
            final Runnable classicEdit = new Runnable() {

                public void run() {

                    CmsEditableData editableData = new CmsEditableData();
                    editableData.setElementLanguage(CmsCoreProvider.get().getLocale());
                    editableData.setStructureId(new CmsUUID(serverId));
                    editableData.setSitePath(element.getSitePath());
                    editableData.setMainLanguage(m_handler.m_controller.getData().getMainLocale());
                    CmsContentEditorDialog.get().openEditDialog(
                        editableData,
                        false,
                        null,
                        new DialogOptions(),
                        CmsContentEditorHandler.this);
                }
            };

            if (m_handler.m_controller.getData().isUseClassicEditor() || element.isNewEditorDisabled()) {
                classicEdit.run();
            } else {
                String editorLocale = CmsCoreProvider.get().getLocale();
                final String mainLocale;
                if (m_handler.m_controller.getData().getMainLocale() == null) {
                    Element htmlEl = CmsDomUtil.querySelector(
                        "[" + CmsGwtConstants.ATTR_DATA_ID + "*='" + serverId + "']",
                        element.getElement());
                    if (htmlEl != null) {
                        String entityId = htmlEl.getAttribute(CmsGwtConstants.ATTR_DATA_ID);
                        mainLocale = CmsContentDefinition.getLocaleFromId(entityId);
                    } else {
                        mainLocale = null;
                    }
                } else {
                    mainLocale = m_handler.m_controller.getData().getMainLocale();
                }
                I_CmsSimpleCallback<Boolean> onClose = new I_CmsSimpleCallback<Boolean>() {

                    public void execute(Boolean hasChangedSettings) {

                        addClosedEditorHistoryItem();
                        onClose(element.getSitePath(), new CmsUUID(serverId), false, hasChangedSettings.booleanValue());
                    }
                };
                if (inline && CmsContentEditor.hasEditable(element.getElement())) {
                    addEditingHistoryItem(true);
                    CmsEditorContext context = getEditorContext();
                    context.setHtmlContextInfo(getContextInfo(element));
                    // remove expired style before initializing the editor
                    element.setReleasedAndNotExpired(true);
                    // in case of new elements, ignore load time
                    CmsDebugLog.consoleLog("Opening inline editor for element. Was new: " + wasNew);
                    long loadTime = wasNew ? Long.MAX_VALUE : m_handler.m_controller.getLoadTime();
                    CmsContentEditor.getInstance().openInlineEditor(
                        context,
                        new CmsUUID(serverId),
                        editorLocale,
                        element,
                        mainLocale,
                        loadTime,
                        onClose);
                } else {
                    addEditingHistoryItem(false);
                    Map<String, String> settingPresets = new HashMap<String, String>();
                    CmsEditorContext context = getEditorContext();
                    I_CmsDropContainer dropContainer = element.getParentTarget();
                    if (dropContainer instanceof CmsContainerPageContainer) {
                        CmsContainerPageContainer container = (CmsContainerPageContainer)dropContainer;
                        settingPresets.putAll(container.getSettingPresets());
                    }
                    context.setSettingPresets(settingPresets);

                    boolean allowSettings = m_handler.m_controller.getData().allowSettingsInEditor()
                        && !m_handler.m_controller.isEditingDisabled()
                        && !serverId.equals(String.valueOf(m_handler.m_controller.getData().getDetailId()));
                    I_CmsSimpleCallback<Boolean> openEditor = new I_CmsSimpleCallback<Boolean>() {

                        public void execute(Boolean lockedPage) {

                            CmsContentEditor.getInstance().openFormEditor(
                                context,
                                editorLocale,
                                serverId,
                                lockedPage.booleanValue() ? getCurrentElementId() : null,
                                null,
                                null,
                                null,
                                null,
                                mainLocale,
                                null,
                                onClose);
                        }
                    };
                    if (allowSettings) {
                        if (m_handler.m_controller.getData().getDetailContainerPage() != null) {
                            CmsCoreProvider.get().lock(
                                m_handler.m_controller.getData().getDetailContainerPage(),
                                m_handler.m_controller.getLoadTime(),
                                openEditor);
                        } else {
                            CmsCoreProvider.get().lock(
                                CmsCoreProvider.get().getStructureId(),
                                m_handler.m_controller.getLoadTime(),
                                openEditor);
                        }
                    } else {
                        openEditor.execute(Boolean.FALSE);
                    }

                }
            }
        } else {
            CmsDebugLog.getInstance().printLine("Editor is already being opened.");
        }
    }
990258
public void setTitle(final String title) {
        if (this.title == null) {
            this.title = new Content();
        }
        this.title.setValue(title);
    }
791038
public String dialogContent(int segment, String title) {

        if (segment == HTML_START) {
            StringBuffer result = new StringBuffer(512);
            // null title is ok, we always want the title headline
            result.append(dialogHead(title));
            result.append("<div class=\"dialogcontent\" unselectable=\"on\">\n");
            result.append("<!-- dialogcontent start -->\n");
            return result.toString();
        } else {
            return "<!-- dialogcontent end -->\n</div>\n";
        }
    }
627182
private void buildOperationTitle(MarkupDocBuilder markupDocBuilder, String title, String anchor) {
        if (config.getPathsGroupedBy() == GroupBy.AS_IS) {
            markupDocBuilder.sectionTitleWithAnchorLevel2(title, anchor);
        } else {
            markupDocBuilder.sectionTitleWithAnchorLevel3(title, anchor);
        }
    }
139396
public String dialogHead(String title) {

        String escapedTitle;
        if (title == null) {
            escapedTitle = "";
        } else {
            escapedTitle = CmsEncoder.escapeHtml(title);
        }

        return "<div class=\"dialoghead\" unselectable=\"on\">" + escapedTitle + "</div>";
    }
281256
public static CmsGroupContainerEditor openGroupcontainerEditor(
        CmsGroupContainerElementPanel groupContainer,
        CmsContainerpageController controller,
        CmsContainerpageHandler handler) {

        // making sure only a single instance of the group-container editor is open
        if (INSTANCE != null) {
            CmsDebugLog.getInstance().printLine("group-container editor already open");
        } else {
            CmsGroupContainerEditor editor = new CmsGroupContainerEditor(groupContainer, controller, handler);
            RootPanel.get().add(editor);
            editor.openDialog(Messages.get().key(Messages.GUI_GROUPCONTAINER_CAPTION_0));
            editor.getGroupContainerWidget().refreshHighlighting();
            INSTANCE = editor;
        }
        return INSTANCE;
    }