Manual work after migration to 0.7
General steps
This small tutorial shows the necessary manual steps needed to get a skeleton application working after migration to qooxdoo 0.7. It is demonstrated for the original skeleton application, so all applications that are based on such a skeleton (which is the recommended way to setup custom apllications) should be rather easy to migrate. This tutorial may not cover all occuring problems. However, all major pitfalls are hopefully addressed by this tutorial.
The following steps are needed after the automatic migration ( see Migration support for details) is done.
- change to the directory of your application or skeleton, respectively
- execute the shell command
make source - add
this.base(arguments);as first line of themain()method
| old | new |
|---|---|
main : function(e)
{
...
| main : function(e) { this.base(arguments); ... |
- change the setting
resourceUritocustom.resoureUri, wherecustomis the default namespace of the skeleton. If your application uses a different namespace, please use your custom namespace. Remember that you have to use a single namespace in the settings name, so if you chose a deep namespace for your application classes, just use a name (most likely the top namespace part) that identifies your application:
| old | new |
|---|---|
settings : { resourceUri : "./resource" } | settings : { "custom.resourceUri" : "./resource" } |
- move the entire code of the
initialize()method at the beginning of themain()method (right after the first line), since theinitialize()method does no longer exist in 0.7. - use the new setting
custom.resourceUrito add your alias
| old | new |
|---|---|
initialize : function(e) { // Define alias for custom resource path qx.io.Alias.getInstance().add("custom", qx.core.Setting.get("resourceUri")); }, | main : function(e) { this.base(arguments); // Define alias for custom resource path qx.io.Alias.getInstance().add("custom", qx.core.Setting.get("custom.resourceUri")); ... } |
- move the code block of the
finalize()method to the end of themain()method.
finalize() method had no relevant content.
- remove any existing
initialize()andfinalize()methods
Colors
The properties color and backgroundColor in qooxdoo 0.7 support only CSS compatible color strings like #FFAA1F and names of themed colors like background.
Settings to those color properties to an array of RGB values or instances of ColorObject does no longer work. The class qx.util.ColorUtil however has functions to convert almost any color declaration to qooxdoo compatible color strings.
| old | new |
|---|---|
this.setColor([124, 20, 0]); | this.setColor("rgb(124,20,0)"); // alternative 1 this.setColor(qx.util.ColorUtil.rgbToRgbString([124, 20, 0])) // alternative 2 |
Base class calls
Base class constructor or other method calls need to be changed. The comparison chart or the section on inheritance has more details.
destruct instead of dispose
All dispose methods, which will have been transferred to the members section, need to be rewritten as destruct entries in the class map. See this article on Destructor support.
Properties
Legacy properties should be rewritten with the new options. The properties will have been preserved with the original settings, marked with a _legacy flag. The 0.7 equivalents to 0.6 are shown here.
Events
Events thrown by a class are indicated in a new events key in the class definition, not by comments. Events that aren’t documented will cause a warning in the debug output. See this section about how to format events.
Debug logging
If you have an entry in your main index.html to turn on logging in debug mode, you may have to change it. The format for 0.7 is given in this section.
Remove clone method
The clone method to clone widget instances is no longer part of the framework in 0.7. In order to have your application running without any problems you have to replace all occurences of this method in your application code.
Replace setState method
If you used the setState method in your application code to describe different states of your widgets you have replace this method with the corresponding methods addState and removeState.
// setState implementation myWidgetInstance.setState("selected", [true|false]); // addState/removeState implementation myWidgetInstance.addState("selected"); myWidgetInstance.removeState("selected");
Replace methods of qx.OO
The qx.OO class e.g. be used to determine if a specific class is available. This can be ueful if you have to do a lookup in your application before you create an instance of a specific class.
The successor of qx.OO in 0.7.x is the qx.Class class. Please use this class if you want to get infos about available classes, mixins etc.
