Skip to main content

Application

Application represents a program instance and is the container of ApplicationFrame and Window

Application Example

class MyApplication extends Application {
public constructor() {
super({
// groupId recommends using a domain name
groupId: 'cn.domain.example',
// Set the name of the application
name: 'application',
// Unique identifier for the item
artifactId: 'example',
// Settings
settings: {
// When running in a nodejs environment, you need to specify the size of the container
nodejs: {
// The size of the container
container: {
width: 1000,
height: 800
}
},
// When running in a browser environment, you need to specify a parent element container,
// and the framework will fill the entire parent element container with content
browser: {
// element selector
container: '#container',
}
},
});
}

public onInstall(context: ApplicationContext): void {

}
}

Instance Method

constructor

declare class Application {
constructor(applicationManifest: ApplicationManifest)
}
  • Description

    Create a new Application.

onInstall

declare class Application {
onInstall(context: ApplicationContext):void
}
  • Description

    The application installation completion is a trigger notification.

onUninstall

declare class Application {
onUninstall():void
}
  • Description

    The application uninstallation completion is a trigger notification.

getApplicationContext

declare class Application {
getApplicationContext():ApplicationContext
}
  • Description

    Gets ApplicationContext