Application Direct Initialization
If you look into our apps.js
you will see, that we have defined application over a function or an
Application Class. In some cases you do not want to write an Application Class because you do not
need encapsulated logic. For example if the application should just start one widget with specific
parameters.
For this case you can define an application directly, specifying an object that would be used in the
init
method as argument for the super.init(config)
call. Let's define an application directly in
the apps.js
:
apps.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
Now you see a hand with sparkles. Clicking on it an application will be started with only one widget.
In the apps.js
you see that we have added an ui
property to show an icon and a panel
property
outside the application definition. This overwrite the global system setting to open each app
maximized and without header. We have to define these options outside the application object,
because the panel options that define how to start a panel have always a higher priority as the
panel options defined by the application itself.