Codenameone Migrating Legacy Applications to CSS II

Viewed 15

I am using Netbeans. I don't know what I'm doing wrong and I'll detail what I've done in sections within the attached image:

Rename theme.res to theme_legacy.res Delete indicated file and folders. In the designer create the constant "theme" and save file. Rename resource file in main class and save file. Activate CSS file and save. In section 6 it shows the incomplete CSS file. After executing the project another "theme" is created as shown in section 7. enter image description here

I appreciate your comments.

1 Answers

To do a "slow migration" just do the following:

  • Remove the includeNativeBool constant from the CSS - this means we inherit the native theme instead of the old theme (which I assume already inherits the native theme). You can only inherit one theme...

  • In the code load the legacy theme just like you do right now

  • Layer the CSS on top by adding the following line: theme = UIManager.initNamedTheme("/theme", "Theme");

Once you do that the theme will include both the legacy code and the new stuff. This is from the developer guide "Theme Layering" section.

Related