Opens a given dialog.<p>

@param dialog to be shown
@param windowCaption caption of window
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();
    }
429757
public static JInternalDialog createDialog (
        JFrame frame, String title, JPanel content)
    {
        JInternalDialog dialog = new JInternalDialog(frame);
        dialog.setOpaque(false);
        if (title != null) {
            dialog.setTitle(title);
        }
        setContent(dialog, content);
        SwingUtil.centerComponent(frame, dialog);
        dialog.showDialog();
        return dialog;
    }
899586
public void openDialog(final I_CmsDialogContext context, String tabId) {

        CmsGwtDialogExtension extension = new CmsGwtDialogExtension(A_CmsUI.get(), new I_CmsUpdateListener<String>() {

            public void onUpdate(List<String> updatedItems) {

                List<CmsUUID> ids = Lists.newArrayList();
                for (String item : updatedItems) {
                    ids.add(new CmsUUID(item));
                }
                context.finish(ids);
            }
        });
        extension.openInfoDialog(context.getResources().get(0), tabId);
    }
990403
public void openDeleteDialog(Set<String> data) {

        CmsDeleteSiteDialog form = new CmsDeleteSiteDialog(this, data);
        openDialog(form, CmsVaadinUtils.getMessageText(Messages.GUI_SITE_DELETE_0));
    }
137415
private static void openDialog(String uploadTarget) {

        try {
            A_CmsUploadDialog dialog = GWT.create(CmsUploadDialogImpl.class);
            dialog.setContext(new I_CmsUploadContext() {

                public void onUploadFinished(List<String> uploadedFiles) {

                    Window.Location.reload();
                }
            });
            dialog.setTargetFolder(uploadTarget);
            dialog.loadAndShow();
        } catch (Exception e) {
            CmsErrorDialog.handleException(
                new Exception(
                    "Deserialization of dialog data failed. This may be caused by expired java-script resources, please clear your browser cache and try again.",
                    e));
        }
    }
851063
void showSourcesWindow(String resource) {

        final Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide);
        CmsSourceDialog sourceDialog = new CmsSourceDialog(m_manager, new Runnable() {

            public void run() {

                window.close();
            }
        });
        sourceDialog.setSource(resource);
        window.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_SEARCHINDEX_INDEXSOURCE_SHOW_1, resource));
        window.setContent(sourceDialog);
        UI.getCurrent().addWindow(window);
    }
1135112
public void installOnDialog(CmsFormDialog dialog) {

        if (CmsCoreProvider.get().getUserInfo().isDeveloper()) {
            setDialog(dialog);
            dialog.addButton(this);
        }
    }
994531
void openPopup() {

        try {
            if (m_popup == null) {
                m_popup = new CmsPopup(Messages.get().key(Messages.GUI_LOCATION_DIALOG_TITLE_0), hasMap() ? 1020 : 420);
                m_popupContent = new CmsLocationPopupContent(
                    this,
                    new CmsLocationSuggestOracle(this),
                    getModeItems(),
                    getTypeItems(),
                    getZoomItems());
                setFieldVisibility();
                m_popup.setMainContent(m_popupContent);
                m_popup.addDialogClose(null);
            }
            m_popup.center();
            m_popup.show();
            initialize();
            updateForm();
        } catch (Throwable t) {
            CmsErrorDialog.handleException(t);
        }
    }
681515
protected void openNewDialog() {

        final Window window = CmsBasicDialog.prepareWindow(DialogWidth.wide);
        CmsBasicDialog dialog = new CmsNewElementDialog(m_cms, m_stateBean.getPath(), window, this);
        window.setContent(dialog);
        window.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_USERMANAGEMENT_ADD_ELEMENT_0));
        A_CmsUI.get().addWindow(window);
    }
263629
@Override
    public String showQuestionDialog(String message, String title, String defaultValue) {
        throw new UnsupportedOperationException();
    }
935793
protected void openEditDialog(boolean isNew, String mode, CmsEditHandlerData handlerDataForNew) {

        CmsContainerpageController.get().getContentEditorHandler().openDialog(
            m_editableData,
            isNew,
            m_parentResourceId,
            mode,
            handlerDataForNew);
    }
290725
protected void openWarningDialog() {

        CmsDeleteWarningDialog dialog = new CmsDeleteWarningDialog(m_editableData.getSitePath());
        Command callback = new Command() {

            /**
             * @see com.google.gwt.user.client.Command#execute()
             */
            public void execute() {

                deleteElement();
            }
        };
        dialog.loadAndShow(callback);
    }
1279796
private void showDialog(@Nullable final Bundle dialogState) {
        AbstractButtonBarDialogBuilder<?, ?> dialogBuilder = createDialogBuilder(dialogTheme);
        dialogBuilder.setFullscreen(isDialogFullscreen());
        dialogBuilder.setMaxWidth(getDialogMaxWidth());
        dialogBuilder.setMaxHeight(getDialogMaxHeight());
        dialogBuilder.setMargin(getDialogLeftMargin(), getDialogTopMargin(), getDialogRightMargin(),
                getDialogBottomMargin());
        dialogBuilder
                .setPadding(getDialogPaddingLeft(), getDialogPaddingTop(), getDialogPaddingRight(),
                        getDialogPaddingBottom());
        dialogBuilder.setFitsSystemWindows(isDialogFitsSystemWindowsLeft(),
                isDialogFitsSystemWindowsTop(), isDialogFitsSystemWindowsRight(),
                isDialogFitsSystemWindowsBottom());
        dialogBuilder.setTitle(getDialogTitle());
        dialogBuilder.setMessage(getDialogMessage());
        dialogBuilder.setPositiveButton(getPositiveButtonText(), this);
        dialogBuilder.setNegativeButton(getNegativeButtonText(), this);
        dialogBuilder.showHeader(isDialogHeaderShown());
        dialogBuilder.showButtonBarDivider(isDialogButtonBarDividerShown());
        dialogBuilder.showDividersOnScroll(areDialogDividersShownOnScroll());
        dialogBuilder.setShowAnimation(getDialogShowAnimation());
        dialogBuilder.setDismissAnimation(getDialogDismissAnimation());
        dialogBuilder.setCancelAnimation(getDialogCancelAnimation());
        dialogBuilder.setIconTintList(getDialogIconTintList());
        dialogBuilder.setIconTintMode(getDialogIconTintMode());
        dialogBuilder.setHeaderIconTintList(getDialogHeaderIconTintList());
        dialogBuilder.setHeaderIconTintMode(getDialogHeaderIconTintMode());

        if (dialogScrollableArea != null) {
            dialogBuilder.setScrollableArea(dialogScrollableArea.getTopScrollableArea(),
                    dialogScrollableArea.getBottomScrollableArea());
        }

        if (dialogIconId != -1) {
            dialogBuilder.setIcon(dialogIconId);
        } else {
            dialogBuilder.setIcon(dialogIconBitmap);
        }

        if (dialogBackgroundId != -1) {
            dialogBuilder.setBackground(dialogBackgroundId);
        } else if (dialogBackgroundColor != -1) {
            dialogBuilder.setBackgroundColor(dialogBackgroundColor);
        } else if (dialogBackgroundBitmap != null) {
            dialogBuilder.setBackground(dialogBackgroundBitmap);
        }

        if (dialogWindowBackgroundId != -1) {
            dialogBuilder.setWindowBackground(dialogWindowBackgroundId);
        } else if (dialogWindowBackgroundBitmap != null) {
            dialogBuilder.setBackground(dialogWindowBackgroundBitmap);
        }

        if (dialogHeaderBackgroundId != -1) {
            dialogBuilder.setHeaderBackground(dialogHeaderBackgroundId);
        } else if (dialogHeaderBackgroundColor != -1) {
            dialogBuilder.setHeaderBackgroundColor(dialogHeaderBackgroundColor);
        } else if (dialogHeaderBackgroundBitmap != null) {
            dialogBuilder.setHeaderBackground(dialogHeaderBackgroundBitmap);
        }

        if (dialogHeaderIconId != -1) {
            dialogBuilder.setHeaderIcon(dialogHeaderIconId);
        } else {
            dialogBuilder.setHeaderIcon(dialogHeaderIconBitmap);
        }

        if (getDialogGravity() != -1) {
            dialogBuilder.setGravity(getDialogGravity());
        }

        if (getDialogWidth() != 0) {
            dialogBuilder.setWidth(getDialogWidth());
        }

        if (getDialogHeight() != 0) {
            dialogBuilder.setHeight(getDialogHeight());
        }

        if (getDialogTitleColor() != -1) {
            dialogBuilder.setTitleColor(getDialogTitleColor());
        }

        if (getDialogTitleTypeface() != null) {
            dialogBuilder.setTitleTypeface(getDialogTitleTypeface());
        }

        if (getDialogMessageColor() != -1) {
            dialogBuilder.setMessageColor(getDialogMessageColor());
        }

        if (getDialogMessageTypeface() != null) {
            dialogBuilder.setMessageTypeface(getDialogMessageTypeface());
        }

        if (getDialogButtonTextColor() != null) {
            dialogBuilder.setButtonTextColor(getDialogButtonTextColor());
        }

        if (getDialogButtonTypeface() != null) {
            dialogBuilder.setButtonTypeface(getDialogButtonTypeface());
        }

        if (getDialogDividerColor() != -1) {
            dialogBuilder.setDividerColor(getDialogDividerColor());
        }

        if (customDialogTitleView != null) {
            dialogBuilder.setCustomTitle(customDialogTitleView);
        }

        if (customDialogTitleViewId != -1) {
            dialogBuilder.setCustomTitle(customDialogTitleViewId);
        }

        if (customDialogMessageView != null) {
            dialogBuilder.setCustomMessage(customDialogMessageView);
        }

        if (customDialogMessageViewId != -1) {
            dialogBuilder.setCustomMessage(customDialogMessageViewId);
        }

        if (customDialogButtonBarView != null) {
            dialogBuilder.setCustomButtonBar(customDialogButtonBarView);
        }

        if (customDialogButtonBarViewId != -1) {
            dialogBuilder.setCustomButtonBar(customDialogButtonBarViewId);
        }

        if (customDialogHeaderView != null) {
            dialogBuilder.setCustomHeader(customDialogHeaderView);
        }

        if (customDialogHeaderViewId != -1) {
            dialogBuilder.setCustomHeader(customDialogHeaderViewId);
        }

        onPrepareDialog(dialogBuilder);
        dialog = createDialog(dialogBuilder);
        dialog.setOnShowListener(this);
        dialog.setOnDismissListener(this);
        dialog.setOnCancelListener(this);
        dialog.setOnKeyListener(this);

        if (dialogState != null) {
            dialog.onRestoreInstanceState(dialogState);
        }

        requestInputMode();
        dialogResultPositive = false;
        dialog.show();
    }
704564
public void setContentToDialog(String caption, Component component) {

        setContent(new Label());
        Window window = CmsBasicDialog.prepareWindow(DialogWidth.narrow);
        CmsBasicDialog dialog = new CmsBasicDialog();
        VerticalLayout result = new VerticalLayout();
        dialog.setContent(result);
        window.setContent(dialog);
        window.setCaption(caption);
        window.setClosable(false);
        addWindow(window);
        window.center();
        if (component instanceof I_CmsHasButtons) {
            I_CmsHasButtons hasButtons = (I_CmsHasButtons)component;
            for (Button button : hasButtons.getButtons()) {
                dialog.addButton(button);
            }

        }
        result.addComponent(component);

    }
878712
public void openSettingsDailog() {

        CmsGlobalForm form = new CmsGlobalForm(this);
        openDialog(form, CmsVaadinUtils.getMessageText(Messages.GUI_SITE_GLOBAL_CONFIGURATION_0));
    }
267034
public void openDialog(String dialogId, String contextType, List<CmsUUID> resources) {

        openDialog(dialogId, contextType, resources, null);
    }
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;
    }