cpr.core.App

A class that defines how to define how to create app instances.

Index

Properties
Name Type Description
focuscyclic Boolean Whether to return from the last focus to the beginning.
id String Your app's id
title String Get the title of your app.
uuid String Your app's unique ID
Methods
Name Return Type Description
allowedAppCache Boolean Returns the "appcache" setting value set in the defaults.js file.
peek App Find the loaded app.
load Promise<cpr.core.App> Load the app.
addHook Add hooks to personalize the process of loading and initializing your app.
removeHook Remove the app hook.
bind IBindFactory Bind to the attribute.
createNewInstance AppInstance Create a new app instance.
getBindInfo BindInfo Returns the bind property information for the control.
getInstances AppInstance[] Returns the instances.
getPreferredSize Dimension When the app runs, it gets the minimum size information it needs.
hasInstances Boolean Returns whether an instance of the app exists.
isBindable Boolean Make sure it is a bindable property.
setPreferredSize Specifies the minimum size required for the app instance to function.
unbind Unbind that property.
unload Unload the app.

Constructor

App(appId, delegate)
Create a new app.
Parameters
name type description
appId String ID of the app.
delegate AppDelegate Delegators that manage the lifecycle of the app.

Properties

focuscyclic
type Boolean
get
Whether to return from the last focus to the beginning.
set
Sets whether to return from the last focus to the beginning.
id
type String
readonly
Your app's id
title
type String
get
Get the title of your app.
set
Set the title of your app.
uuid
type String
readonly
Your app's unique ID

Methods

allowedAppCache()
Returns the "appcache" setting value set in the defaults.js file. The default value is true.
return Boolean
peek(appID)
Find the loaded app. If not loaded, null is returned.
Parameters
name type description
appID #app ID of the app to find (URI)
return App
load(appURI, doneHandler)
Load the app.
Parameters
name type description
appURI #app Your app's id
doneHandleroptional (loadedApp: cpr.core.App)=>Void Callback function to pass app as parameter
return Promise<cpr.core.App>
addHook(hook)
Add hooks to personalize the process of loading and initializing your app.
Parameters
name type description
hook AppHook App hook to add.
removeHook(hook)
Remove the app hook.
Parameters
name type description
hook AppHook App hook to uninstall.
bind(name)
Bind to the attribute.
Parameters
name type description
name String The name of the attribute.
return IBindFactory
createNewInstance()
Create a new app instance.
return AppInstance
getBindInfo(name)
Returns the bind property information for the control.
Parameters
name type description
name String The name of the attribute being bound.
return BindInfo BindInfo Properties
getInstances()
Returns the instances.
return AppInstance[]
getPreferredSize()
When the app runs, it gets the minimum size information it needs.
return Dimension
hasInstances()
Returns whether an instance of the app exists.
return Boolean
isBindable(name)
Make sure it is a bindable property.
Parameters
name type description
name String Attribute name
return Boolean Confirmation.
setPreferredSize(width, height)
Specifies the minimum size required for the app instance to function.
Parameters
name type description
width Number Minimum width. Negative numbers indicate no constraint.
height Number Minimum height. Negative numbers indicate no constraint.
setPreferredSize(size)
Specifies the minimum size required for the app instance to function.
Parameters
name type description
size Dimension Minimum size
unbind(name)
Unbind that property.
Parameters
name type description
name String Attribute name to unbind.
unload()
Unload the app. If there are instances running, it will not work and will throw an exception.