sap.ui.define([
	"sap/m/App",
	"sap/m/Button",
	"sap/m/Label",
	"sap/m/library",
	"sap/m/Page",
	"sap/m/Title",
	"sap/ui/core/library"
], function(App, Button, Label, mobileLibrary, Page, Title, coreLibrary) {
	"use strict";

	// shortcut for sap.m.ButtonType
	var ButtonType = mobileLibrary.ButtonType;

	// shortcut for sap.ui.core.TitleLevel
	var TitleLevel = coreLibrary.TitleLevel;

	var app = new App("myApp");

	var page1 = new Page("page1", {
		title:"Button Test page",
		content : [
			new Label("L1", { text: "go to homepage", width: "100%" }),
			new Title({ text: "Default Buttons", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home" }),
			new Button({ text: "Home", enabled: false }),
			new Button({ text: "Home", icon: "sap-icon://home" }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false }),
			new Button({ icon: "sap-icon://home", tooltip: "Home" }),

			new Title({ text: "Default Buttons with label", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaLabelledBy: ["L1"] }),
			new Button({ text: "Home", enabled: false, ariaLabelledBy: ["L1"] }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaLabelledBy: ["L1"] }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaLabelledBy: ["L1"] }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaLabelledBy: ["L1"] }),

			new Title({ text: "Default Buttons with Description", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaDescribedBy: ["L1"] }),
			new Button({ text: "Home", enabled: false, ariaDescribedBy: ["L1"] }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaDescribedBy: ["L1"] }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaDescribedBy: ["L1"] }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaDescribedBy: ["L1"] }),

			new Title({ text: "Buttons with special types", level: TitleLevel.H2, width: "100%" }),
			new Title({ text: "Type: Back", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", type: ButtonType.Back }),
			new Button({ text: "Home", enabled: false, type: ButtonType.Back }),
			new Button({ text: "Home", icon: "sap-icon://home", type: ButtonType.Back }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, type: ButtonType.Back }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", type: ButtonType.Back }),
			new Title({ text: "Type: Back with label", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Back }),
			new Button({ text: "Home", enabled: false, ariaLabelledBy: ["L1"], type: ButtonType.Back }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaLabelledBy: ["L1"], type: ButtonType.Back }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaLabelledBy: ["L1"], type: ButtonType.Back }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Back }),
			new Title({ text: "Type: Back with Description", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Back }),
			new Button({ text: "Home", enabled: false, ariaDescribedBy: ["L1"], type: ButtonType.Back }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaDescribedBy: ["L1"], type: ButtonType.Back }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaDescribedBy: ["L1"], type: ButtonType.Back }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Back }),

			new Title({ text: "Type: Up", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", type: ButtonType.Up }),
			new Button({ text: "Home", enabled: false, type: ButtonType.Up }),
			new Button({ text: "Home", icon: "sap-icon://home", type: ButtonType.Up }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, type: ButtonType.Up }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", type: ButtonType.Up }),
			new Title({ text: "Type: Up with label", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Up }),
			new Button({ text: "Home", enabled: false, ariaLabelledBy: ["L1"], type: ButtonType.Up }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaLabelledBy: ["L1"], type: ButtonType.Up }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaLabelledBy: ["L1"], type: ButtonType.Up }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Up }),
			new Title({ text: "Type: Up with Description", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Up }),
			new Button({ text: "Home", enabled: false, ariaDescribedBy: ["L1"], type: ButtonType.Up }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaDescribedBy: ["L1"], type: ButtonType.Up }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaDescribedBy: ["L1"], type: ButtonType.Up }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Up }),

			new Title({ text: "Type: Accept", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", type: ButtonType.Accept }),
			new Button({ text: "Home", enabled: false, type: ButtonType.Accept }),
			new Button({ text: "Home", icon: "sap-icon://home", type: ButtonType.Accept }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, type: ButtonType.Accept }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", type: ButtonType.Accept }),
			new Title({ text: "Type: Accept with label", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Accept }),
			new Button({ text: "Home", enabled: false, ariaLabelledBy: ["L1"], type: ButtonType.Accept }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaLabelledBy: ["L1"], type: ButtonType.Accept }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaLabelledBy: ["L1"], type: ButtonType.Accept }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Accept }),
			new Title({ text: "Type: Accept with Description", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Accept }),
			new Button({ text: "Home", enabled: false, ariaDescribedBy: ["L1"], type: ButtonType.Accept }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaDescribedBy: ["L1"], type: ButtonType.Accept }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaDescribedBy: ["L1"], type: ButtonType.Accept }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Accept }),

			new Title({ text: "Type: Reject", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", type: ButtonType.Reject }),
			new Button({ text: "Home", enabled: false, type: ButtonType.Reject }),
			new Button({ text: "Home", icon: "sap-icon://home", type: ButtonType.Reject }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, type: ButtonType.Reject }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", type: ButtonType.Reject }),
			new Title({ text: "Type: Reject with label", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Reject }),
			new Button({ text: "Home", enabled: false, ariaLabelledBy: ["L1"], type: ButtonType.Reject }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaLabelledBy: ["L1"], type: ButtonType.Reject }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaLabelledBy: ["L1"], type: ButtonType.Reject }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Reject }),
			new Title({ text: "Type: Reject with Description", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Reject }),
			new Button({ text: "Home", enabled: false, ariaDescribedBy: ["L1"], type: ButtonType.Reject }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaDescribedBy: ["L1"], type: ButtonType.Reject }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaDescribedBy: ["L1"], type: ButtonType.Reject }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Reject }),

			new Title({ text: "Type: Attention", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", type: ButtonType.Attention }),
			new Button({ text: "Home", enabled: false, type: ButtonType.Attention }),
			new Button({ text: "Home", icon: "sap-icon://home", type: ButtonType.Attention }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, type: ButtonType.Attention }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", type: ButtonType.Attention }),
			new Title({ text: "Type: Attention with label", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Attention }),
			new Button({ text: "Home", enabled: false, ariaLabelledBy: ["L1"], type: ButtonType.Attention }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaLabelledBy: ["L1"], type: ButtonType.Attention }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaLabelledBy: ["L1"], type: ButtonType.Attention }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Attention }),
			new Title({ text: "Type: Attention with Description", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Attention }),
			new Button({ text: "Home", enabled: false, ariaDescribedBy: ["L1"], type: ButtonType.Attention }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaDescribedBy: ["L1"], type: ButtonType.Attention }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaDescribedBy: ["L1"], type: ButtonType.Attention }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Attention }),

			new Title({ text: "Type: Emphasized", level: TitleLevel.H3, width: "100%" }),
			new Button({ text: "Home", type: ButtonType.Emphasized }),
			new Button({ text: "Home", enabled: false, type: ButtonType.Emphasized }),
			new Button({ text: "Home", icon: "sap-icon://home", type: ButtonType.Emphasized }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, type: ButtonType.Emphasized }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", type: ButtonType.Emphasized }),
			new Title({ text: "Type: Emphasized with label", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Emphasized }),
			new Button({ text: "Home", enabled: false, ariaLabelledBy: ["L1"], type: ButtonType.Emphasized }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaLabelledBy: ["L1"], type: ButtonType.Emphasized }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaLabelledBy: ["L1"], type: ButtonType.Emphasized }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaLabelledBy: ["L1"], type: ButtonType.Emphasized }),
			new Title({ text: "Type: Emphasized with Description", level: TitleLevel.H2, width: "100%" }),
			new Button({ text: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Emphasized }),
			new Button({ text: "Home", enabled: false, ariaDescribedBy: ["L1"], type: ButtonType.Emphasized }),
			new Button({ text: "Home", icon: "sap-icon://home", ariaDescribedBy: ["L1"], type: ButtonType.Emphasized }),
			new Button({ text: "Home", icon: "sap-icon://home", iconFirst: false, ariaDescribedBy: ["L1"], type: ButtonType.Emphasized }),
			new Button({ icon: "sap-icon://home", tooltip: "Home", ariaDescribedBy: ["L1"], type: ButtonType.Emphasized })
		]
	});

	app.addPage(page1);

	app.placeAt("body");
});
