/*! * UI development toolkit for HTML5 (OpenUI5) * (c) Copyright 2009-2018 SAP SE or an SAP affiliate company. * Licensed under the Apache License, Version 2.0 - see LICENSE.txt. */ sap.ui.define([ "./library"], function (library) { "use strict"; /** * DynamicPage Title renderer. * @namespace */ var DynamicPageTitleRenderer = {}; /** * Renders the HTML for the given control, using the provided {@link sap.ui.core.RenderManager}. * * @param {sap.ui.core.RenderManager} oRm The RenderManager that can be used for writing to the Render-Output-Buffer * @param {sap.ui.core.Control} oDynamicPageTitle An object representation of the control that should be rendered */ DynamicPageTitleRenderer.render = function (oRm, oDynamicPageTitle) { var oDynamicPageTitleState = oDynamicPageTitle._getState(), sSapFDynamicPageTitle = "sapFDynamicPageTitle", sBackgroundDesign = oDynamicPageTitle.getBackgroundDesign(); // DynamicPageTitle Root DOM Element. oRm.write(""); oRm.renderControl(oDynamicPageTitleState.focusSpan); this._renderTopArea(oRm, oDynamicPageTitleState); this._renderMainArea(oRm, oDynamicPageTitleState); oRm.renderControl(oDynamicPageTitleState.expandButton); oRm.write(""); }; DynamicPageTitleRenderer._renderTopArea = function (oRm, oDynamicPageTitleState) { if (oDynamicPageTitleState.hasTopContent) { oRm.write("
"); this._renderTopBreadcrumbsArea(oRm, oDynamicPageTitleState); this._renderTopNavigationArea(oRm, oDynamicPageTitleState); oRm.write("
"); } }; DynamicPageTitleRenderer._renderTopBreadcrumbsArea = function (oRm, oDynamicPageTitleState) { if (oDynamicPageTitleState.breadcrumbs) { oRm.write(""); oRm.renderControl(oDynamicPageTitleState.breadcrumbs); oRm.write(""); } }; DynamicPageTitleRenderer._renderTopNavigationArea = function (oRm, oDynamicPageTitleState) { if (oDynamicPageTitleState.hasNavigationActions) { oRm.write(""); oRm.write(""); } }; DynamicPageTitleRenderer._renderMainArea = function (oRm, oDynamicPageTitleState) { oRm.write("
"); oRm.write(""); this._renderMainHeadingArea(oRm, oDynamicPageTitleState); this._renderMainContentArea(oRm, oDynamicPageTitleState); this._renderMainActionsArea(oRm, oDynamicPageTitleState); oRm.write("
"); this._renderMainNavigationArea(oRm, oDynamicPageTitleState); oRm.write(""); // Root end. }; DynamicPageTitleRenderer._renderMainHeadingArea = function (oRm, oDynamicPageTitleState) { // Heading Area oRm.write(""); // Left Area -> heading aggregation oRm.write(""); if (oDynamicPageTitleState.heading) { // If heading is given, it should be used oRm.renderControl(oDynamicPageTitleState.heading); } else { // Otherwise, snapped and expanded heading should be used if (oDynamicPageTitleState.snappedHeading) { DynamicPageTitleRenderer._renderSnappedHeading(oRm, oDynamicPageTitleState); } if (oDynamicPageTitleState.expandedHeading) { DynamicPageTitleRenderer._renderExpandHeading(oRm, oDynamicPageTitleState); } } oRm.write(""); // Heading Area -> snappedContent/expandContent aggregation if (oDynamicPageTitleState.hasAdditionalContent) { oRm.write(""); if (oDynamicPageTitleState.hasSnappedContent) { DynamicPageTitleRenderer._renderSnappedContent(oRm, oDynamicPageTitleState); } if (oDynamicPageTitleState.hasExpandedContent) { DynamicPageTitleRenderer._renderExpandContent(oRm, oDynamicPageTitleState); } oRm.write(""); } oRm.write(""); }; DynamicPageTitleRenderer._renderMainContentArea = function (oRm, oDynamicPageTitleState) { // Content aggregation oRm.write(""); oDynamicPageTitleState.content.forEach(oRm.renderControl); oRm.write(""); }; DynamicPageTitleRenderer._renderMainActionsArea = function (oRm, oDynamicPageTitleState) { oRm.write(""); if (oDynamicPageTitleState.hasActions) { oRm.renderControl(oDynamicPageTitleState.actionBar); } oRm.write(""); }; DynamicPageTitleRenderer._renderMainNavigationArea = function (oRm, oDynamicPageTitleState) { if (oDynamicPageTitleState.hasNavigationActions) { oRm.write(""); oRm.renderControl(oDynamicPageTitleState.separator); oRm.write(""); oRm.write(""); oRm.write(""); } }; DynamicPageTitleRenderer._renderExpandHeading = function (oRm, oDynamicPageTitleState) { oRm.write(""); oRm.renderControl(oDynamicPageTitleState.expandedHeading); oRm.write(""); }; DynamicPageTitleRenderer._renderSnappedHeading = function (oRm, oDynamicPageTitleState) { oRm.write(""); oRm.renderControl(oDynamicPageTitleState.snappedHeading); oRm.write(""); }; DynamicPageTitleRenderer._renderExpandContent = function (oRm, oDynamicPageTitleState) { oRm.write(""); oDynamicPageTitleState.expandedContent.forEach(oRm.renderControl); oRm.write(""); }; DynamicPageTitleRenderer._renderSnappedContent = function (oRm, oDynamicPageTitleState) { oRm.write(""); oDynamicPageTitleState.snappedContent.forEach(oRm.renderControl); oRm.write(""); }; return DynamicPageTitleRenderer; }, /* bExport= */ true);