<commit_before><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>sap.m.Toolbar</title>

<script src="shared-config.js"></script>
<script src="../../../resources/sap-ui-core.js"
	id="sap-ui-bootstrap" data-sap-ui-libs="sap.m">
</script>

<style type="text/css"></style>

<script>
	// initialize
	var oUriParameters = jQuery.sap.getUriParameters();
	jQuery.sap.require("sap.m.MessageToast");
	jQuery.sap.require("sap.m.ToolbarDesign");
	jQuery.sap.require("sap.m.Toolbar");
	jQuery.sap.require("sap.ui.core.IconPool");

	// for behaviour testing
	if (oUriParameters.get("oldFlex")) {
		sap.m.ToolbarRenderer.hasNewFlexBoxSupport = false;
	}

	var oApp = new sap.m.App();
	var sAddIconURI = sap.ui.core.IconPool.getIconURI("add");

	function getToolbarContent (sText, sSelId) {
		return [
			new sap.m.Button({text : "Button"}),
			new sap.m.ToolbarSeparator(),
			new sap.m.Button({text : "Test"}),
			new sap.m.Label({
				text: "Choose:",
				labelFor: sSelId
			}),
			new sap.m.Select(sSelId, {
				autoAdjustWidth: true,
				items : [
					new sap.ui.core.Item({
							key: "0",
							text: "item 0"
						}),
					new sap.ui.core.Item({
							key: "0",
							text: "loooooooooooooong item"
					})
				]
			}),
			new sap.m.SearchField({
				placeholder : "Search",
				width : "200px"
			}),
			new sap.m.SegmentedButton({
				buttons: [
					new sap.m.Button({
						type: sap.m.ButtonType.Default,
						icon: sAddIconURI,
						enabled: true
					}),
					new sap.m.Button({
						type: sap.m.ButtonType.Default,
						icon: sAddIconURI,
						enabled: true
					}),
					new sap.m.Button({
						type: sap.m.ButtonType.Default,
						icon: sAddIconURI,
						enabled: true
					}),
					new sap.m.Button({
						type: sap.m.ButtonType.Default,
						icon: sAddIconURI,
						enabled: true
					})
				]
			}),
			new sap.m.Button({text : "Button"}),
			new sap.m.Select({
				type: sap.m.SelectType.IconOnly,
				icon: sap.ui.core.IconPool.getIconURI("filter"),
				autoAdjustWidth: true,
				items : [
					new sap.ui.core.Item({
						key: "0",
						text: "item 0"
					}),
					new sap.ui.core.Item({
						key: "0",
						text: "loooooooooooooong item"
					})
				]
			}),
			new sap.m.ToolbarSpacer(),
			new sap.m.Label({ text : sText }),
			new sap.m.ToolbarSpacer(),
			new sap.m.Label({
				text: "Choose:",
				labelFor: sSelId + 'innerSelect'
			}),
			new sap.m.Select(sSelId + 'innerSelect', {
				items : [
					new sap.ui.core.Item({
						key: "0",
						text: "item 0"
					}),
					new sap.ui.core.Item({
						key: "0",
						text: "loooooooooooooong item"
					})
				]
			})
		]
	}

	function getInputToolbarContent () {
		return [
			new sap.m.Label({
				text : "Input controls"
			}),
			new sap.m.ToolbarSpacer(),
			new sap.m.ToggleButton({
				text: "Press to toggle"
			}),
			new sap.m.Input({
				placeholder: "Input",
				width: "150px"
			}),
			new sap.m.DateTimePicker({
				placeholder: "DateTimePicker",
				width: "250px"
			}),
			new sap.m.CheckBox({
				text : "Checkbox"
			}),
			new sap.m.RadioButton({
				text : "Option a",
				group : "a"
			}),
			new sap.m.RadioButton({
				text : "Option b",
				group : "b"
			})
		];
	}

	TBHeader = new sap.m.Toolbar({
		content : getToolbarContent("This is a Header", "selH")
	});

	TBSubHeader = new sap.m.Toolbar({
		content : getToolbarContent("This is a SubHeader", "selSubH")
	});

	TBFooter = new sap.m.Toolbar({
		content : getToolbarContent("This is a Footer", "selF")
	});

	// test toolbars in dialog
	var oDialog = new sap.m.Dialog({
		title: "Toolbar Dialog",
		content: [
			oList = new sap.m.List({
				headerToolbar : new sap.m.Toolbar({
					content : [
						new sap.m.Label({
							text : "This is a header"
						}),
						new sap.m.ToolbarSpacer(),
						new sap.m.Button({
							text : "Remove",
							type : "Reject",
							press : function() {
								oList.getHeaderToolbar().destroy();
							}
						})
					]
				})
			}),
			oList.getHeaderToolbar().clone().setDesign("Info").setHeight("auto")
		],
 		beginButton: new sap.m.Button({
 			text: "Close",
 			press : function() {
				oDialog.close()
			}
 		})
	});

	// add toolbars to the page
	var oPage = new sap.m.Page("toolbar-page", {
		customHeader : TBHeader,
		subHeader : TBSubHeader,
		footer : TBFooter,
		title : "Toolbar",
		enableScrolling : true,
		headerContent : new sap.m.Button({
			text : "Open Dialog",
			press : function() {
				oDialog.open()
			}
		}),
		content : [
			new sap.m.Toolbar("info_bar", {
				active : true,
				design : sap.m.ToolbarDesign.Info,
				tooltip : "This is a info bar",
				content : [
					new sap.m.Label({
						text : "Plain old infobar"
					}),
					new sap.m.Label({text: "Text"}),
					new sap.m.Label({text: "Text"}),
					new sap.m.ToolbarSpacer(),
					new sap.m.Label({text: "Text"}),
					new sap.m.Label({text: "Text"}),
					new sap.ui.core.Icon({
						src : "sap-icon://collaborate",
						width : "2rem"
					})
				]
			}).attachPress(function(oEvent) {
				sap.m.MessageToast.show("InfoBar Pressed! Sorce: " + oEvent.getParameter("srcControl").getId());
			}),
			new sap.m.Toolbar({
				design : sap.m.ToolbarDesign.Solid,
				height : "auto",
				content : [
					new sap.m.Label({
						text : "This text should never get shrink.",
						layoutData : new sap.m.ToolbarLayoutData({
							shrinkable : false
						})
					}),
					new sap.m.ToolbarSpacer(),
					new sap.m.Button({
						text : "This Button is shrinkable up to 100px",
						icon: "sap-icon://person-placeholder",
						layoutData : new sap.m.ToolbarLayoutData({
							shrinkable : true,
							minWidth: "100px"
						}),
						press : function() {
							sap.m.MessageToast.show("Shrinkable button is pressed.",  {
								at: "center center"
							});
						}
					})
				]
			}),
			new sap.m.Toolbar({
				height: "auto",
				content : [
					new sap.m.Label({
						text : "Percent Width Controls",
						labelFor: "searchField",
						width: "15%"
					}),<commit_msg>[FIX] Toolbar: sample page changed<commit_after><!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>sap.m.Toolbar</title>

<script src="shared-config.js"></script>
<script src="../../../resources/sap-ui-core.js"
	id="sap-ui-bootstrap" data-sap-ui-libs="sap.m">
</script>

<style type="text/css"></style>

<script>
	// initialize
	var oUriParameters = jQuery.sap.getUriParameters();
	jQuery.sap.require("sap.m.MessageToast");
	jQuery.sap.require("sap.m.ToolbarDesign");
	jQuery.sap.require("sap.m.Toolbar");
	jQuery.sap.require("sap.ui.core.IconPool");

	// for behaviour testing
	if (oUriParameters.get("oldFlex")) {
		sap.m.ToolbarRenderer.hasNewFlexBoxSupport = false;
	}

	var oApp = new sap.m.App();
	var sAddIconURI = sap.ui.core.IconPool.getIconURI("add");

	function getToolbarContent (sText, sSelId) {
		return [
			new sap.m.Button({text : "Button"}),
			new sap.m.ToolbarSeparator(),
			new sap.m.Button({text : "Test"}),
			new sap.m.Label({
				text: "Choose:",
				labelFor: sSelId
			}),
			new sap.m.Select(sSelId, {
				autoAdjustWidth: true,
				items : [
					new sap.ui.core.Item({
							key: "0",
							text: "item 0"
						}),
					new sap.ui.core.Item({
							key: "0",
							text: "loooooooooooooong item"
					})
				]
			}),
			new sap.m.SearchField({
				placeholder : "Search",
				width : "200px"
			}),
			new sap.m.SegmentedButton({
				buttons: [
					new sap.m.Button({
						type: sap.m.ButtonType.Default,
						icon: sAddIconURI,
						enabled: true
					}),
					new sap.m.Button({
						type: sap.m.ButtonType.Default,
						icon: sAddIconURI,
						enabled: true
					}),
					new sap.m.Button({
						type: sap.m.ButtonType.Default,
						icon: sAddIconURI,
						enabled: true
					}),
					new sap.m.Button({
						type: sap.m.ButtonType.Default,
						icon: sAddIconURI,
						enabled: true
					})
				]
			}),
			new sap.m.Button({text : "Button"}),
			new sap.m.Select({
				type: sap.m.SelectType.IconOnly,
				icon: sap.ui.core.IconPool.getIconURI("filter"),
				autoAdjustWidth: true,
				items : [
					new sap.ui.core.Item({
						key: "0",
						text: "item 0"
					}),
					new sap.ui.core.Item({
						key: "0",
						text: "loooooooooooooong item"
					})
				]
			}),
			new sap.m.ToolbarSpacer(),
			new sap.m.Label({ text : sText }),
			new sap.m.ToolbarSpacer(),
			new sap.m.Label({
				text: "Choose:",
				labelFor: sSelId + 'innerSelect'
			}),
			new sap.m.Select(sSelId + 'innerSelect', {
				items : [
					new sap.ui.core.Item({
						key: "0",
						text: "item 0"
					}),
					new sap.ui.core.Item({
						key: "0",
						text: "loooooooooooooong item"
					})
				]
			})
		]
	}

	function getInputToolbarContent () {
		return [
			new sap.m.Label({
				text : "Input controls"
			}),
			new sap.m.ToolbarSpacer(),
			new sap.m.ToggleButton({
				text: "Press to toggle"
			}),
			new sap.m.Input({
				placeholder: "Input",
				width: "150px"
			}),
			new sap.m.DateTimePicker({
				placeholder: "DateTimePicker",
				width: "250px"
			}),
			new sap.m.CheckBox({
				text : "Checkbox"
			}),
			new sap.m.RadioButton({
				text : "Option a",
				group : "a"
			}),
			new sap.m.RadioButton({
				text : "Option b",
				group : "b"
			})
		];
	}

	TBHeader = new sap.m.Toolbar({
		content : getToolbarContent("This is a Header", "selH")
	});

	TBSubHeader = new sap.m.Toolbar({
		content : getToolbarContent("This is a SubHeader", "selSubH")
	});

	TBFooter = new sap.m.Toolbar({
		content : getToolbarContent("This is a Footer", "selF")
	});

	// test toolbars in dialog
	var oDialog = new sap.m.Dialog({
		title: "Toolbar Dialog",
		content: [
			oList = new sap.m.List({
				headerToolbar : new sap.m.Toolbar({
					content : [
						new sap.m.Label({
							text : "This is a header"
						}),
						new sap.m.ToolbarSpacer(),
						new sap.m.Button({
							text : "Remove",
							type : "Reject",
							press : function() {
								oList.getHeaderToolbar().destroy();
							}
						})
					]
				})
			}),
			oList.getHeaderToolbar().clone().setDesign("Info").setHeight("auto")
		],
 		beginButton: new sap.m.Button({
 			text: "Close",
 			press : function() {
				oDialog.close()
			}
 		})
	});

	var iMessageToastDuration = 500;

	// add toolbars to the page
	var oPage = new sap.m.Page("toolbar-page", {
		customHeader : TBHeader,
		subHeader : TBSubHeader,
		footer : TBFooter,
		title : "Toolbar",
		enableScrolling : true,
		headerContent : new sap.m.Button({
			text : "Open Dialog",
			press : function() {
				oDialog.open()
			}
		}),
		content : [
			new sap.m.Toolbar("info_bar", {
				active : true,
				design : sap.m.ToolbarDesign.Info,
				tooltip : "This is a info bar",
				content : [
					new sap.m.Label({
						text : "Plain old infobar"
					}),
					new sap.m.Label({text: "Text"}),
					new sap.m.Label({text: "Text"}),
					new sap.m.ToolbarSpacer(),
					new sap.m.Label({text: "Text"}),
					new sap.m.Label({text: "Text"}),
					new sap.ui.core.Icon({
						src : "sap-icon://collaborate",
						width : "2rem"
					})
				]
			}).attachPress(function(oEvent) {
				sap.m.MessageToast.show("InfoBar Pressed! Sorce: " + oEvent.getParameter("srcControl").getId(), {
					duration: iMessageToastDuration
				});
			}),
			new sap.m.Toolbar({
				design : sap.m.ToolbarDesign.Solid,
				height : "auto",
				content : [
					new sap.m.Label({
						text : "This text should never get shrink.",
						layoutData : new sap.m.ToolbarLayoutData({
							shrinkable : false
						})
					}),
					new sap.m.ToolbarSpacer(),
					new sap.m.Button({
						text : "This Button is shrinkable up to 100px",
						icon: "sap-icon://person-placeholder",
						layoutData : new sap.m.ToolbarLayoutData({
							shrinkable : true,
							minWidth: "100px"
						}),
						press : function() {
							sap.m.MessageToast.show("Shrinkable button is pressed.",  {
								at: "center center",
								duration: iMessageToastDuration
							});
						}
					})
				]
			}),
			new sap.m.Toolbar({
				height: "auto",
				content : [
					new sap.m.Label({
						text : "Percent Width Controls",
						labelFor: "searchField",
						width: "15%"
					}),
{'fraction_non_alphanumeric': 0.16807066328616996, 'fraction_numerical': 0.004661814018156539, 'mean_word_length': 2.3556531284302964, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 6, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3932107', 'n_tokens_mistral': 5812, 'n_tokens_neox': 4374, 'n_words': 883}