Final Class sap.ui.core.CoreModule: sap/ui/core/Core

extends Object

Core Class of the SAP UI Library.

This class boots the Core framework and makes it available for the Application via the method sap.ui.getCore().

Example:

   var oCore = sap.ui.getCore();

It provides events where the Application can attach to.
Example:
oCore.attachInit(function () {
  //do the needful, do it lean
});

It registers the Browser Eventing.

Constructor Summary
Event Summary
formatError(oControlEvent)The 'formatError' event is fired when a value formatting fails.
localizationChanged(oEvent)Fired when any of the localization relevant configuration settings has changed (e.g.
parseError(oControlEvent)The 'parseError' event is fired when input parsing fails.
validationError(oControlEvent)The 'validationError' event is fired when validation of the input fails.
validationSuccess(oControlEvent)The 'validationSuccess' event is fired when a value validation was successfully completed.
Method Summary
sap.ui.core.Core.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.Core with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.Core.getMetadata()Returns a metadata object for class sap.ui.core.Core.
applyChanges()Enforces an immediate update of the visible UI (aka "rendering").
applyTheme(sThemeName, sThemeBaseUrl?)Applies the theme with the given name (by loading the respective style sheets, which does not disrupt the application).
attachControlEvent(fnFunction, oListener?)Registers a listener for control events.
attachFormatError(fnFunction, oListener?)Attach event-handler fnFunction to the 'formatError' event of sap.ui.core.Core.
attachInit(fnFunction)Attaches a given function to the initEvent event of the core.
attachIntervalTimer(fnFunction, oListener?)Registers a listener to the central interval timer.
attachLocalizationChanged(fnFunction, oListener)Register a listener for the localizationChanged event.
attachParseError(oData?, fnFunction, oListener?)Attach event-handler fnFunction to the 'parseError' event of sap.ui.core.Core.
attachValidationError(oData?, fnFunction, oListener?)Attach event-handler fnFunction to the 'validationError' event of sap.ui.core.Core.
attachValidationSuccess(oData?, fnFunction, oListener?)Attach event-handler fnFunction to the 'validationSuccess' event of sap.ui.core.Core.
byFieldGroupId(vFieldGroupIds?)Returns a list of all controls with a field group ID.
byId(sId)Returns the registered element for the given id, if any.
createComponent(vComponent, sUrl?, sId?, mSettings?)Creates a component with the provided id and settings.
createRenderManager()Returns a new instance of the RenderManager interface.
detachControlEvent(fnFunction, oListener?)Unregisters a listener for control events.
detachFormatError(fnFunction, oListener)Detach event-handler fnFunction from the 'formatError' event of sap.ui.core.Core.
detachIntervalTimer(fnFunction, oListener?)Unregisters a listener for the central interval timer.
detachLocalizationChanged(fnFunction, oListener)Unregister a listener from the localizationChanged event.
detachParseError(fnFunction, oListener)Detach event-handler fnFunction from the 'parseError' event of sap.ui.core.Core.
detachValidationError(fnFunction, oListener)Detach event-handler fnFunction from the 'validationError' event of sap.ui.core.Core.
detachValidationSuccess(fnFunction, oListener)Detach event-handler fnFunction from the 'validationSuccess' event of sap.ui.core.Core.
fireFormatError(mArguments?)Fire event formatError to attached listeners.
fireParseError(mArguments?)Fire event parseError to attached listeners.
fireValidationError(mArguments?)Fire event validationError to attached listeners.
fireValidationSuccess(mArguments?)Fire event validationSuccess to attached listeners.
getComponent(sId)Returns the registered component for the given id, if any.
getConfiguration()Returns the Configuration of the Core.
getCurrentFocusedControlId()Returns the Id of the control/element currently in focus.
getEventBus()Returns the event bus.
getLibraryResourceBundle(sLibraryName?, sLocale?)Retrieves a resource bundle for the given library and locale.
getLoadedLibraries()Returns a map which contains the names of the loaded libraries as keys and some additional information about each library as values.
getMessageManager()Returns the active MessageManager instance.
getModel(sName?)Get the model with the given model name.
getRootComponent()Returns the instance of the root component (if exists).
getStaticAreaRef()Returns the static, hidden area DOM element belonging to this core instance.
getUIArea(o)Returns a UIArea if the given ID/Element belongs to one.
getUIDirty()Returns true if there are any pending rendering tasks or when such rendering tasks are currently being executed.
hasModel()Check if a Model is set to the core
includeLibraryTheme(sLibName, sVariant?, sQuery?)Includes a library theme into the current page (if a variant is specified it will include the variant library theme)
initLibrary(vLibInfo)Initializes a library for an already loaded library module.
isInitialized()Returns true if the Core has already been initialized.
isLocked()Returns the locked state of the sap.ui.core.Core
isMobile()Check if the script is running on mobile
isStaticAreaRef(oDomRef)Used to find out whether a certain DOM element is the static area
isThemeApplied()Returns true, if the styles of the current theme are already applied, false otherwise.
loadLibrary(sLibrary, sUrl?)Synchronously loads the given library and makes it available to the application.
lock()Locks the Core.
registerPlugin(oPlugin)Registers a Plugin to the sap.ui.core.Core, which lifecycle will be managed (start and stop).
setModel(oModel, sName?)Sets or unsets a model for the given model name.
setThemeRoot(sThemeName, aLibraryNames?, sThemeBaseUrl)Defines the root directory from below which UI5 should load the theme with the given name.
unlock()Unlocks the Core.
unregisterPlugin(oPlugin)Unregisters a Plugin out of the sap.ui.core.Core
attachInitEvent(fnFunction)Attaches a given function to the initEvent event of the core.
createUIArea(oDomRef)Creates a new sap.ui.core.UIArea.
getApplication()Returns the instance of the application (if exists).
getControl(sId)Returns the registered element for the given ID, if any.
getElementById(sId)Returns the registered element for the given ID, if any.
getTemplate(sId)Returns the registered template for the given id, if any.
setRoot(oDomRef, oControl)Implicitly creates a new UIArea (or reuses an exiting one) for the given DOM reference and adds the given control reference to the UIAreas content (existing content will be removed).
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.core.Core()
Event Detail
formatError(oControlEvent)
The 'formatError' event is fired when a value formatting fails. This can happen when a value stored in the model cannot be formatted to be displayed in an element property.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.core.Element}oControlEvent.getParameters.element The Element where the format error occurred
{string}oControlEvent.getParameters.property The property name of the element where the format error occurred
{type}oControlEvent.getParameters.type The type of the property
{object}oControlEvent.getParameters.newValue The value of the property which was entered when the format error occurred
{object}oControlEvent.getParameters.oldValue The value of the property which was present before a new value was entered (before the format error)
{object}oControlEvent.getParameters.exception The exception object which occurred and has more information about the format error
localizationChanged(oEvent)
Fired when any of the localization relevant configuration settings has changed (e.g. language, rtl, formatLocale, datePattern, timePattern, numberSymbol, legacy formats).

The parameter changes contains additional information about the change. It is a plain object that can contain one or more of the following properties

  • language - the language setting has changed
  • rtl - the character orientation mode (aka 'LTR/RTL mode') has changed
  • formatLocale - the format locale has changed
(there might be other, currently undocumented settings)

The value for each property will be the new corresponding setting.

Parameters:
{sap.ui.base.Event}oEvent
{sap.ui.base.EventProvider}oEvent.getSource
{object}oEvent.getParameters
{object}oEvent.getParameters.changes a map of the changed localization properties
parseError(oControlEvent)
The 'parseError' event is fired when input parsing fails.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.core.Element}oControlEvent.getParameters.element The Element where the parse error occurred
{string}oControlEvent.getParameters.property The property name of the element where the parse error occurred
{type}oControlEvent.getParameters.type The type of the property
{object}oControlEvent.getParameters.newValue The value of the property which was entered when the parse error occurred
{object}oControlEvent.getParameters.oldValue The value of the property which was present before a new value was entered (before the parse error)
{object}oControlEvent.getParameters.exception The exception object which occurred and has more information about the parse error
validationError(oControlEvent)
The 'validationError' event is fired when validation of the input fails.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.core.Element}oControlEvent.getParameters.element The Element where the validation error occurred
{string}oControlEvent.getParameters.property The property name of the element where the validation error occurred
{type}oControlEvent.getParameters.type The type of the property
{object}oControlEvent.getParameters.newValue The value of the property which was entered when the validation error occurred
{object}oControlEvent.getParameters.oldValue The value of the property which was present before a new value was entered (before the validation error)
{object}oControlEvent.getParameters.exception The exception object which occurred and has more information about the validation error
validationSuccess(oControlEvent)
The 'validationSuccess' event is fired when a value validation was successfully completed.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{sap.ui.core.Element}oControlEvent.getParameters.element The Element where the successful validation occurred
{string}oControlEvent.getParameters.property The property name of the element where the successfull validation occurred
{type}oControlEvent.getParameters.type The type of the property
{object}oControlEvent.getParameters.newValue The value of the property which was entered when the validation occurred
{object}oControlEvent.getParameters.oldValue The value of the property which was present before a new value was entered (before the validation)
Method Detail
sap.ui.core.Core.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.Core with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.core.Core.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.Core.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
applyChanges()
Enforces an immediate update of the visible UI (aka "rendering").

In general, applications should avoid calling this method and instead let the framework manage any necessary rendering.

applyTheme(sThemeName, sThemeBaseUrl?)
Applies the theme with the given name (by loading the respective style sheets, which does not disrupt the application).

By default, the theme files are expected to be located at path relative to the respective control library ([libraryLocation]/themes/[themeName]). Different locations can be configured by using the method setThemePath() or by using the second parameter "sThemeBaseUrl" of applyTheme(). Usage of this second parameter is a shorthand for setThemePath and internally calls setThemePath, so the theme location is then known.

sThemeBaseUrl is a single URL to specify the default location of all theme files. This URL is the base folder below which the control library folders are located. E.g. if the CSS files are not located relative to the root location of UI5, but instead they are at locations like http://my.server/myapp/resources/sap/ui/core/themes/my_theme/library.css then the URL that needs to be given is: http://my.server/myapp/resources All theme resources are then loaded from below this folder - except if for a certain library a different location has been registered.

If the theme resources are not all either below this base location or with their respective libraries, then setThemePath must be used to configure individual locations.

Parameters:
{string}sThemeName the name of the theme to be loaded
{string}sThemeBaseUrl? the (optional) base location of the theme
attachControlEvent(fnFunction, oListener?)
Registers a listener for control events.
Parameters:
{function}fnFunction callback to be called for each control event
{object}oListener? optional context object to call the callback on.
attachFormatError(fnFunction, oListener?): sap.ui.core.Core
Attach event-handler fnFunction to the 'formatError' event of sap.ui.core.Core.
Please note that this event is a bubbling event and may already be canceled before reaching the core.
Parameters:
{function}fnFunction The function to call, when the event occurs. This function will be called on the oListener-instance (if present) or in a 'static way'.
{object}oListener? Object on which to call the given function. If empty, this Model is used.
Returns:
{sap.ui.core.Core}this to allow method chaining
attachInit(fnFunction)
Attaches a given function to the initEvent event of the core.

The given callback function will either be called once the Core has been initialized or, if it has been initialized already, it will be called immediately.

Parameters:
{function}fnFunction the callback function to be called on event firing.
Since:
1.13.2
attachIntervalTimer(fnFunction, oListener?)
Registers a listener to the central interval timer.
Parameters:
{function}fnFunction callback to be called periodically
{object}oListener? optional context object to call the callback on.
Since:
1.16.0
attachLocalizationChanged(fnFunction, oListener)
Register a listener for the localizationChanged event.
Parameters:
{function}fnFunction callback to be called
{object}oListener context object to cal lthe function on.
attachParseError(oData?, fnFunction, oListener?): sap.ui.core.Core
Attach event-handler fnFunction to the 'parseError' event of sap.ui.core.Core.
Please note that this event is a bubbling event and may already be canceled before reaching the core.
Parameters:
{object}oData? The object, that should be passed along with the event-object when firing the event
{function}fnFunction The function to call, when the event occurs. This function will be called on the oListener-instance (if present) or in a 'static way'.
{object}oListener? Object on which to call the given function. If empty, this Model is used.
Returns:
{sap.ui.core.Core}this to allow method chaining
attachValidationError(oData?, fnFunction, oListener?): sap.ui.core.Core
Attach event-handler fnFunction to the 'validationError' event of sap.ui.core.Core.
Please note that this event is a bubbling event and may already be canceled before reaching the core.
Parameters:
{object}oData? The object, that should be passed along with the event-object when firing the event
{function}fnFunction The function to call, when the event occurs. This function will be called on the oListener-instance (if present) or in a 'static way'.
{object}oListener? Object on which to call the given function. If empty, this Model is used.
Returns:
{sap.ui.core.Core}this to allow method chaining
attachValidationSuccess(oData?, fnFunction, oListener?): sap.ui.core.Core
Attach event-handler fnFunction to the 'validationSuccess' event of sap.ui.core.Core.
Please note that this event is a bubbling event and may already be canceled before reaching the core.
Parameters:
{object}oData? The object, that should be passed along with the event-object when firing the event
{function}fnFunction The function to call, when the event occurs. This function will be called on the oListener-instance (if present) or in a 'static way'.
{object}oListener? Object on which to call the given function. If empty, this Model is used.
Returns:
{sap.ui.core.Core}this to allow method chaining
byFieldGroupId(vFieldGroupIds?): sap.ui.core.Control[]
Returns a list of all controls with a field group ID. See Control.prototype.checkFieldGroupIds for a description of the vFieldGroupIds parameter.
Parameters:
{string|string[]}vFieldGroupIds? ID of the field group or an array of field group IDs to match
Returns:
{sap.ui.core.Control[]} The list of controls with matching field group IDs
Returns the registered element for the given id, if any.
Parameters:
{string}sId
Returns:
{sap.ui.core.Element} the element for the given id
createComponent(vComponent, sUrl?, sId?, mSettings?)
Creates a component with the provided id and settings.

When the optional parameter sUrl is given, then all request for resources of the library will be redirected to the given Url. This is convenience for a call to

  jQuery.sap.registerModulePath(sName, sUrl);
Parameters:
{string|object}vComponent name of the component to import or object containing all needed parameters
{string}vComponent.name? name of the component to import
{string}vComponent.url? URL to load the component from
{string}vComponent.id? ID for the component instance
{object}vComponent.settings? settings object for the component
{string}vComponent.componentData? user specific data which is available during the whole lifecycle of the component
{string}sUrl? the URL to load the component from
{string}sId? the ID for the component instance
{object}mSettings? the settings object for the component
createRenderManager(): sap.ui.core.RenderManager
Returns a new instance of the RenderManager interface.
Returns:
{sap.ui.core.RenderManager} the new instance of the RenderManager interface.
detachControlEvent(fnFunction, oListener?)
Unregisters a listener for control events.

A listener will only be unregistered if the same function/context combination is given as in the attachControlEvent call.

Parameters:
{function}fnFunction function to unregister
{object}oListener? context object given during registration
detachFormatError(fnFunction, oListener): sap.ui.core.Core
Detach event-handler fnFunction from the 'formatError' event of sap.ui.core.Core.

The passed function and listener object must match the ones previously used for event registration.

Parameters:
{function}fnFunction The callback function to unregister
{object}oListener Object on which the given function had to be called.
Returns:
{sap.ui.core.Core}this to allow method chaining
detachIntervalTimer(fnFunction, oListener?)
Unregisters a listener for the central interval timer.

A listener will only be unregistered if the same function/context combination is given as in the attachIntervalTimer call.

Parameters:
{function}fnFunction function to unregister
{object}oListener? context object given during registration
Since:
1.16.0
detachLocalizationChanged(fnFunction, oListener)
Unregister a listener from the localizationChanged event.

The listener will only be unregistered if the same function/context combination is given as in the call to attachLocalizationListener.

Parameters:
{function}fnFunction callback to be deregistered
{object}oListener context object given in a previous call to attachLocalizationChanged.
detachParseError(fnFunction, oListener): sap.ui.core.Core
Detach event-handler fnFunction from the 'parseError' event of sap.ui.core.Core.

The passed function and listener object must match the ones previously used for event registration.

Parameters:
{function}fnFunction The callback function to unregister.
{object}oListener Object on which the given function had to be called.
Returns:
{sap.ui.core.Core}this to allow method chaining
detachValidationError(fnFunction, oListener): sap.ui.core.Core
Detach event-handler fnFunction from the 'validationError' event of sap.ui.core.Core.

The passed function and listener object must match the ones previously used for event registration.

Parameters:
{function}fnFunction The callback function to unregister
{object}oListener Object on which the given function had to be called.
Returns:
{sap.ui.core.Core}this to allow method chaining
detachValidationSuccess(fnFunction, oListener): sap.ui.core.Core
Detach event-handler fnFunction from the 'validationSuccess' event of sap.ui.core.Core.

The passed function and listener object must match the ones previously used for event registration.

Parameters:
{function}fnFunction The function to call, when the event occurs.
{object}oListener Object on which the given function had to be called.
Returns:
{sap.ui.core.Core}this to allow method chaining
fireFormatError(mArguments?): sap.ui.core.Core
Fire event formatError to attached listeners.

Expects following event parameters:

  • 'element' of type sap.ui.core.Element
  • 'property' of type string
  • 'type' of type string
  • 'newValue' of type object
  • 'oldValue' of type object
  • 'exception' of type object
Parameters:
{Map}mArguments? the arguments to pass along with the event.
Returns:
{sap.ui.core.Core}this to allow method chaining
fireParseError(mArguments?): sap.ui.core.Core
Fire event parseError to attached listeners.

Expects following event parameters:

  • 'element' of type sap.ui.core.Element
  • 'property' of type string
  • 'type' of type string
  • 'newValue' of type object
  • 'oldValue' of type object
  • 'exception' of type object
Parameters:
{Map}mArguments? the arguments to pass along with the event.
Returns:
{sap.ui.core.Core}this to allow method chaining
fireValidationError(mArguments?): sap.ui.core.Core
Fire event validationError to attached listeners.

Expects following event parameters:

  • 'element' of type sap.ui.core.Element
  • 'property' of type string
  • 'type' of type string
  • 'newValue' of type object
  • 'oldValue' of type object
  • 'exception' of type object
Parameters:
{Map}mArguments? the arguments to pass along with the event.
Returns:
{sap.ui.core.Core}this to allow method chaining
fireValidationSuccess(mArguments?): sap.ui.core.Core
Fire event validationSuccess to attached listeners.

Expects following event parameters:

  • 'element' of type sap.ui.core.Element
  • 'property' of type string
  • 'type' of type string
  • 'newValue' of type object
  • 'oldValue' of type object
Parameters:
{Map}mArguments? the arguments to pass along with the event.
Returns:
{sap.ui.core.Core}this to allow method chaining
getComponent(sId): sap.ui.core.Component
Returns the registered component for the given id, if any.
Parameters:
{string}sId
Returns:
{sap.ui.core.Component} the component for the given id
getConfiguration(): sap.ui.core.Configuration
Returns the Configuration of the Core.
Returns:
{sap.ui.core.Configuration} the Configuration of the current Core.
getCurrentFocusedControlId(): string
Returns the Id of the control/element currently in focus.
Returns:
{string} the Id of the control/element currently in focus.
getEventBus(): sap.ui.core.EventBus
Returns the event bus.
Since:
1.8.0
Returns:
{sap.ui.core.EventBus} the event bus
getLibraryResourceBundle(sLibraryName?, sLocale?): jQuery.sap.util.ResourceBundle
Retrieves a resource bundle for the given library and locale.

If only one argument is given, it is assumed to be the libraryName. The locale then falls back to the current session locale. If no argument is given, the library also falls back to a default: "sap.ui.core".

Parameters:
{string}sLibraryName?, Default: 'sap.ui.core' name of the library to retrieve the bundle for
{string}sLocale? locale to retrieve the resource bundle for
Returns:
{jQuery.sap.util.ResourceBundle} the best matching resource bundle for the given parameters or undefined
getLoadedLibraries(): map
Returns a map which contains the names of the loaded libraries as keys and some additional information about each library as values.

Experimental API:The details of the 'values' in the returned map are not yet specified! Their structure might change in future versions without notice. So applications can only rely on the set of keys as well as the pure existance of a value.

Experimental:
The details of the 'values' in the returned map are not yet specified! Their structure might change in future versions without notice. So applications can only rely on the set of keys as well as the pure existance of a value.
Returns:
{map} map of library names / controls
Returns the active MessageManager instance.
Since:
1.33.0
Returns:
{sap.ui.core.message.MessageManager}
getModel(sName?): sap.ui.model.Model
Get the model with the given model name.

The name can be omitted to reference the default model or it must be a non-empty string.

Note: to be compatible with future versions of this API, applications must not use the value null, the empty string "" or the string literals "null" or "undefined" as model name.

Parameters:
{string|undefined}sName? name of the model to be retrieved
Returns:
{sap.ui.model.Model} oModel
getRootComponent(): sap.ui.core.Component
Returns the instance of the root component (if exists).
Returns:
{sap.ui.core.Component} instance of the current root component
getStaticAreaRef(): Element
Returns the static, hidden area DOM element belonging to this core instance.

It can be used e.g. for hiding elements like Popups, Shadow, Blocklayer etc.

If it is not yet available, a DIV is created and appended to the body.

Exceptions:
{Error} an Error if the document is not yet ready
Returns:
{Element} the static, hidden area DOM element belonging to this core instance.
getUIArea(o): sap.ui.core.UIArea
Returns a UIArea if the given ID/Element belongs to one.
Parameters:
{string|Element}o a DOM Element or ID string of the UIArea
Returns:
{sap.ui.core.UIArea} a UIArea with a given id or dom ref.
getUIDirty(): boolean
Returns true if there are any pending rendering tasks or when such rendering tasks are currently being executed.
Returns:
{boolean} true if there are pending (or executing) rendering tasks.
hasModel(): boolean
Check if a Model is set to the core
Returns:
{boolean} true or false
includeLibraryTheme(sLibName, sVariant?, sQuery?)
Includes a library theme into the current page (if a variant is specified it will include the variant library theme)
Parameters:
{string}sLibName the name of the UI library
{string}sVariant? the variant to include (optional)
{string}sQuery? to be used only by the Core
initLibrary(vLibInfo)
Initializes a library for an already loaded library module.

This method is intended to be called only from a library.js (e.g. generated code). It includes the library specific stylesheet into the current page, and creates lazy import stubs for all controls and elements in the library.

As a result, consuming applications don't have to write import statements for the controls or for the enums.

Synchronously loads any libraries that the given library depends on.

Parameters:
{string|object}vLibInfo name of or info object for the library to import
isInitialized(): boolean
Returns true if the Core has already been initialized. This means that instances of RenderManager etc. do already exist and the init event has already been fired (and will not be fired again).
Returns:
{boolean} whether the Core has already been initialized
isLocked(): boolean
Returns the locked state of the sap.ui.core.Core
Returns:
{boolean} locked state
isMobile(): boolean
Check if the script is running on mobile
Returns:
{boolean} true or false
isStaticAreaRef(oDomRef): boolean
Used to find out whether a certain DOM element is the static area
Parameters:
{object}oDomRef
Returns:
{boolean} whether the given DomRef is the StaticAreaRef
isThemeApplied(): boolean
Returns true, if the styles of the current theme are already applied, false otherwise.

This function must not be used before the init event of the Core. If the styles are not yet applied an theme changed event will follow when the styles will be applied.

Returns:
{boolean} whether the styles of the current theme are already applied
loadLibrary(sLibrary, sUrl?)
Synchronously loads the given library and makes it available to the application.

Loads the *.library module, which contains all preload modules (enums, types, content of a shared.js if it exists). The library module will call initLibrary with additional metadata for the library.

As a result, consuming applications can instantiate any control or element from that library without having to write import statements for the controls or for the enums.

When the optional parameter sUrl is given, then all request for resources of the library will be redirected to the given Url. This is convenience for a call to

  jQuery.sap.registerModulePath(sLibrary, sUrl);

When the given library has been loaded already, no further action will be taken. Especially, a given Url will not be honored!

Note: this method does not participate in the supported preload of libraries.

Parameters:
{string}sLibrary name of the library to import
{string}sUrl? URL to load the library from
lock()
Locks the Core. No browser events are dispatched to the controls.

Lock should be called before and after the dom is modified for rendering, roundtrips... Exceptions might be the case for asynchronous UI behavior

registerPlugin(oPlugin)
Registers a Plugin to the sap.ui.core.Core, which lifecycle will be managed (start and stop).
Plugin object need to implement two methods:
  • startPlugin(oCore): will be invoked, when the Plugin should start (as parameter the reference to the Core will be provided
  • stopPlugin(): will be invoked, when the Plugin should stop
Parameters:
{object}oPlugin reference to a Plugin object
setModel(oModel, sName?): sap.ui.core.Core
Sets or unsets a model for the given model name.

The sName must either be undefined (or omitted) or a non-empty string. When the name is omitted, the default model is set/unset.

When oModel is null or undefined, a previously set model with that name is removed from the Core.

Any change (new model, removed model) is propagated to all existing UIAreas and their descendants as long as a descendant doesn't have its own model set for the given name.

Note: to be compatible with future versions of this API, applications must not use the value null, the empty string "" or the string literals "null" or "undefined" as model name.

Parameters:
{sap.ui.model.Model}oModel the model to be set or null or undefined
{string}sName? the name of the model or undefined
Returns:
{sap.ui.core.Core}this to allow method chaining
setThemeRoot(sThemeName, aLibraryNames?, sThemeBaseUrl): sap.ui.core.Core
Defines the root directory from below which UI5 should load the theme with the given name. Optionally allows restricting the setting to parts of a theme covering specific control libraries.

Example: core.setThemeRoot("my_theme", "http://mythemeserver.com/allThemes"); core.applyTheme("my_theme"); will cause the following file to be loaded: http://mythemeserver.com/allThemes/sap/ui/core/themes/my_theme/library.css (and the respective files for all used control libraries, like http://mythemeserver.com/allThemes/sap/ui/commons/themes/my_theme/library.css if the sap.ui.commons library is used)

If parts of the theme are at different locations (e.g. because you provide a standard theme like "sap_goldreflection" for a custom control library and this self-made part of the standard theme is at a different location than the UI5 resources), you can also specify for which control libraries the setting should be used, by giving an array with the names of the respective control libraries as second parameter: core.setThemeRoot("sap_goldreflection", ["my.own.library"], "http://mythemeserver.com/allThemes"); This will cause the Gold Reflection theme to be loaded normally from the UI5 location, but the part for styling the "my.own.library" controls will be loaded from: http://mythemeserver.com/allThemes/my/own/library/themes/sap_goldreflection/library.css

If the custom theme should be loaded initially (via bootstrap attribute), the "themeRoots" property of the window["sap-ui-config"] object must be used instead of Core.setThemeRoot(...) in order to configure the theme location early enough.

Parameters:
{string}sThemeName the name of the theme for which to configure the location
{string[]}aLibraryNames? the optional library names to which the configuration should be restricted
{string}sThemeBaseUrl the base URL below which the CSS file(s) will be loaded from
Since:
1.10
Returns:
{sap.ui.core.Core} the Core, to allow method chaining
unlock()
Unlocks the Core.

Browser events are dispatched to the controls again after this method is called.

unregisterPlugin(oPlugin)
Unregisters a Plugin out of the sap.ui.core.Core
Parameters:
{object}oPlugin reference to a Plugin object
attachInitEvent(fnFunction)
Attaches a given function to the initEvent event of the core.

This event will only be fired once; you can check if it has been fired already by calling isInitialized.

Parameters:
{function}fnFunction the function to be called on event firing.
Deprecated:
since 1.13.2 Register to the more convenient init event instead
createUIArea(oDomRef): sap.ui.core.UIArea
Creates a new sap.ui.core.UIArea.
Parameters:
{string|Element}oDomRef a DOM Element or ID string of the UIArea
Deprecated:
Use setRoot() instead!
Returns:
{sap.ui.core.UIArea} a new UIArea
getApplication(): sap.ui.app.Application
Returns the instance of the application (if exists).
Deprecated:
Since 1.15.1. The Component class is enhanced to take care about the Application code.
Returns:
{sap.ui.app.Application} instance of the current application
getControl(sId): sap.ui.core.Element
Returns the registered element for the given ID, if any.
Parameters:
{string}sId
Deprecated:
use sap.ui.core.Core.byId instead!
Returns:
{sap.ui.core.Element} the element for the given id
getElementById(sId): sap.ui.core.Element
Returns the registered element for the given ID, if any.
Parameters:
{string}sId
Deprecated:
use sap.ui.core.Core.byId instead!
Returns:
{sap.ui.core.Element} the element for the given id
getRenderManager()
Deprecated:
Since version 0.15.0. Replaced by createRenderManager()
getTemplate(sId): sap.ui.core.Component
Returns the registered template for the given id, if any.
Parameters:
{string}sId
Deprecated:
Since 1.29.1 Require 'sap/ui/core/tmpl/Template' and use Template.byId instead.
Returns:
{sap.ui.core.Component} the template for the given id
setRoot(oDomRef, oControl)
Implicitly creates a new UIArea (or reuses an exiting one) for the given DOM reference and adds the given control reference to the UIAreas content (existing content will be removed).
Parameters:
{string|Element}oDomRef a DOM Element or Id (string) of the UIArea
{sap.ui.base.Interface|sap.ui.core.Control}oControl the Control that should be the added to the UIArea.
Deprecated:
Use function oControl.placeAt(oDomRef, "only") of sap.ui.core.Control instead.