WebStorm UI5 File Templates

UI5 Controller Template (AMD)

use extension: controller.js

sap.ui.define([
    "sap/ui/core/mvc/Controller"
], function (Controller) {
    "use strict";

    return Controller.extend("${UI5_Namespace}.controller.${NAME}", {
        onInit: function () {
            this.component = this.getOwnerComponent();
            this.bus = this.component.getEventBus();
        }
    });
});

UI5 JS View Template (AMD)

use extension: view.js

sap.ui.define([
    "sap/m/Page",
    "sap/m/Bar"
], function (Page, Bar) {
    "use strict";

    sap.ui.jsview("${UI5_Namespace}.view.${NAME}", {

        getControllerName: function () {
            return "${UI5_Namespace}.controller.${NAME}";
        },

        createContent: function (oController) {
            var that = this;
            var component = sap.ui.component(sap.ui.core.Component.getOwnerIdFor(this));
            var bus = component.getEventBus();

            return new Page({
                showNavButton: true,
                //navButtonPress: oController.onNavBack,
                title: "${NAME}",
                footer: new Bar({})
            });
        }

    });

});

UI5 XML View Template

use extension: view.xml

<mvc:View
        controllerName="${UI5_Namespace}.controller.${NAME}"
        xmlns="sap.m"
        xmlns:l="sap.ui.layout"
        xmlns:core="sap.ui.core"
        xmlns:mvc="sap.ui.core.mvc">
    <Page title="${NAME}"
          navButtonPress="onNavBack"
          showNavButton="true">
        <content>
        </content>
        <footer>
            <Bar>
            </Bar>
        </footer>
    </Page>
</mvc:View>