Creates a drop down menu.<p>

@param icon the button icon
@param content the drop down content
@param title the button title

@return the component
760575
public static Component createDropDown(ExternalResource icon, Component content, String title) {

        return createDropDown(getDropDownButtonHtml(icon), content, title);
    }
250494
public ContextMenuItem addItem(String caption, Resource icon) {

        ContextMenuItem item = addItem(caption);
        item.setIcon(icon);
        return item;
    }
854783
protected function createModal($title, $content = null, array $buttons = [])
    {
        $modal = new Modal($title);

        $buttons = [];

        if (empty($buttons)) {
            $buttons['submit'] = [
                'id'       => 'submit',
                'label'    => 'ekyna_core.button.save',
                'icon'     => 'glyphicon glyphicon-ok',
                'cssClass' => 'btn-success',
                'autospin' => true,
            ];
        }
        if (!array_key_exists('close', $buttons)) {
            $buttons['close'] = [
                'id'       => 'close',
                'label'    => 'ekyna_core.button.cancel',
                'icon'     => 'glyphicon glyphicon-remove',
                'cssClass' => 'btn-default',
            ];
        }

        $modal->setButtons($buttons);

        if ($content) {
            $modal->setContent($content);
        }

        return $modal;
    }
1362477
public void createAndEditNewElement(
        final org.opencms.ade.containerpage.client.ui.CmsContainerPageElementPanel element,
        final boolean inline) {

        if (!element.isNew()) {
            return;
        }

        final CmsContainer container = m_containers.get(element.getParentTarget().getContainerId());

        m_handler.showPageOverlay();
        CmsRpcAction<CmsCreateElementData> action = new CmsRpcAction<CmsCreateElementData>() {

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
             */
            @Override
            public void execute() {

                getContainerpageService().checkCreateNewElement(
                    CmsCoreProvider.get().getStructureId(),
                    element.getId(),
                    element.getNewType(),
                    container,
                    getLocale(),
                    this);

            }

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
             */
            @Override
            protected void onResponse(CmsCreateElementData result) {

                if (result.needsModelSelection()) {
                    getHandler().openModelResourceSelect(element, result.getModelResources());
                } else {
                    openEditorForNewElement(element, result.getCreatedElement(), inline);
                }
            }
        };
        action.execute();
    }
1270938
public static Optional<ButtonType> showWarning(String title, String content) {
        return showWarning(title, null, content);
    }
1344475
public String iconsBlockArea(int segment, String headline) {

        StringBuffer result = new StringBuffer(512);
        if (segment == HTML_START) {
            result.append("<!-- icons block area start -->\n");
            result.append("<div class=\"dialogcontent\" unselectable=\"on\">");
            result.append("<fieldset class=\"dialogblock\">\n");
            result.append("<legend>");
            result.append("<span class=\"textbold");
            result.append("\" unselectable=\"on\">");
            result.append(headline);
            result.append("</span></legend>\n");
            result.append("\t\t<table class='toolsArea' width='100%' cellspacing='0' cellpadding='0' border='0'>\n");
            result.append("\t\t\t<tr><td>\n");
        } else {
            result.append("\t\t\t</td></tr>\n");
            result.append("\t\t</table>\n");
            result.append("</fieldset></div>\n");
            result.append("<p>&nbsp;</p>\n");
            result.append("<!-- icons block area end -->\n");
        }
        return result.toString();
    }
175385
@Override
  public final org.jdom2.Element addContent(Content content) {
    // ignore empty elements
    if (content == null) {
      return null;
    }
    return super.addContent(content);
  }
483011
public static Optional<ButtonType> alert(String title, String header, String content) {
        return alert(title, header, content, AlertType.INFORMATION);
    }
689950
public static Button createIconButton(Resource icon, String caption) {

        Button button = new Button();

        button.addStyleName(OpenCmsTheme.BUTTON_TABLE_ICON);
        button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
        button.setIcon(icon);
        button.setDescription(caption);
        return button;
    }
1280129
public static Resource getSitemapResourceIcon(CmsObject cms, CmsResource resource, IconMode iconMode) {

        CmsResource defaultFile = null;
        List<CmsResource> resourcesForType = Lists.newArrayList();
        resourcesForType.add(resource);
        boolean skipDefaultFile = (iconMode == IconMode.sitemapSelect)
            && OpenCms.getResourceManager().matchResourceType(
                CmsResourceTypeFolderSubSitemap.TYPE_SUBSITEMAP,
                resource.getTypeId());
        if (resource.isFolder() && !skipDefaultFile) {

            try {
                defaultFile = cms.readDefaultFile(resource, CmsResourceFilter.IGNORE_EXPIRATION);
                if (defaultFile != null) {
                    resourcesForType.add(0, defaultFile);
                }
            } catch (Exception e) {
                // Shouldn't normally happen - readDefaultFile returns null instead of throwing an exception when it doesn't find a default file
            }
        }
        if (CmsJspNavBuilder.isNavLevelFolder(cms, resource)) {
            return new CmsCssIcon(CmsExplorerTypeSettings.ICON_STYLE_NAV_LEVEL_BIG);
        }
        CmsResource maybePage = resourcesForType.get(0);
        if (CmsResourceTypeXmlContainerPage.isContainerPage(maybePage)) {
            CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(cms, maybePage.getRootPath());
            for (CmsDetailPageInfo realInfo : config.getAllDetailPages(true)) {
                if (realInfo.getUri().equals(maybePage.getRootPath())
                    || realInfo.getUri().equals(CmsResource.getParentFolder(maybePage.getRootPath()))) {
                    CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                        realInfo.getIconType());
                    if (settings != null) {
                        return CmsResourceUtil.getBigIconResource(settings, resource.getName());
                    }
                }
            }
        }

        Resource result = null;
        for (CmsResource res : resourcesForType) {
            I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(res);
            CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(type.getTypeName());
            if (settings != null) {
                result = CmsResourceUtil.getBigIconResource(settings, res.getName());
                break;
            }
        }
        return result;
    }
631555
public void setContent(IContent content)
	{
		this.content = content;
		content.setParent(this);
		content.setPosition(Position.middleCenter(content).plus(offsetPosition));
	}
556907
public void setEditIcon(Icon editIcon, String text) {
        if (editIcon != null) {
            editButton.setIcon(editIcon);
            if (text != null) {
                editButton.setToolTipText(text);
            }
            editButton.setText("");
        } else {
            editButton.setIcon(null);
            if (text != null) {
                editButton.setText(text);
            }
        }
    }
981956
public static Button createIconButton(String name, String description, Resource icon, String buttonStyle) {

        Button button = new Button(name);
        button.setIcon(icon, name);
        button.setDescription(description);
        button.addStyleName(OpenCmsTheme.APP_BUTTON);
        button.addStyleName(ValoTheme.BUTTON_BORDERLESS);
        button.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_TOP);
        if (buttonStyle != null) {
            button.addStyleName(buttonStyle);
        }
        if ((icon instanceof CmsCssIcon) && ((CmsCssIcon)icon).hasAdditionalButtonStyle()) {
            button.addStyleName(((CmsCssIcon)icon).getAdditionalButtonStyle());
        }
        return button;
    }
401655
public static Button createAppIconButton(I_CmsWorkplaceAppConfiguration appConfig, Locale locale) {

        return createIconButton(
            appConfig.getName(locale),
            appConfig.getHelpText(locale),
            appConfig.getIcon(),
            appConfig.getButtonStyle());
    }
1030622
public static Component createAppButton(
        CmsObject cms,
        final I_CmsWorkplaceAppConfiguration appConfig,
        Locale locale) {

        Button button = createAppIconButton(appConfig, locale);
        button.addClickListener(new ClickListener() {

            private static final long serialVersionUID = 1L;

            public void buttonClick(ClickEvent event) {

                if ((appConfig instanceof I_CmsHasAppLaunchCommand)
                    && (((I_CmsHasAppLaunchCommand)appConfig).getAppLaunchCommand() != null)) {
                    ((I_CmsHasAppLaunchCommand)appConfig).getAppLaunchCommand().run();
                } else {
                    CmsAppWorkplaceUi ui = (CmsAppWorkplaceUi)A_CmsUI.get();
                    ui.showApp(appConfig);
                }
            }
        });
        CmsAppVisibilityStatus status = appConfig.getVisibility(cms);
        if (!status.isActive()) {
            button.setEnabled(false);
            button.setDescription(status.getHelpText());
        } else {
            String helpText = appConfig.getHelpText(locale);
            button.setDescription(helpText);
        }
        return button;
    }
981028
public static Button createAppFolderIconButton(I_CmsFolderAppCategory appCat, Locale locale) {

        return createIconButton(
            appCat.getName(locale),
            appCat.getHelpText(locale),
            appCat.getIcon(),
            appCat.getButtonStyle());
    }
235359
public static Optional<ButtonType> showInformation(String title, String content) {
        return showInformation(title, null, content);
    }