| 2327 | |
| 2328 | /// {@inheritDoc} |
| 2329 | @Override |
| 2330 | public void refreshTheme(boolean merge) { |
| 2331 | // when changing the theme when a title/menu bar is not visible the refresh |
| 2332 | // won't apply to them. We need to protect against this occurance. |
| 2333 | if (menuBar != null) { |
| 2334 | menuBar.refreshTheme(merge); |
| 2335 | } |
| 2336 | if (titleArea != null) { |
| 2337 | titleArea.refreshTheme(merge); |
| 2338 | } |
| 2339 | if (toolbar != null) { |
| 2340 | toolbar.refreshTheme(merge); |
| 2341 | } |
| 2342 | |
| 2343 | super.refreshTheme(merge); |
| 2344 | |
| 2345 | if (toolbar == null) { |
| 2346 | // when changing the theme the menu behavior might also change |
| 2347 | hideMenu(); |
| 2348 | restoreMenu(); |
| 2349 | Command[] cmds = new Command[getCommandCount()]; |
| 2350 | for (int iter = 0; iter < cmds.length; iter++) { |
| 2351 | cmds[iter] = getCommand(iter); |
| 2352 | } |
| 2353 | removeAllCommands(); |
| 2354 | for (Command cmd : cmds) { |
| 2355 | addCommand(cmd, getCommandCount()); |
| 2356 | } |
| 2357 | if (getBackCommand() != null) { |
| 2358 | setBackCommand(getBackCommand()); |
| 2359 | } |
| 2360 | } |
| 2361 | |
| 2362 | revalidateWithAnimationSafety(); |
| 2363 | } |
| 2364 | |
| 2365 | /// Exposing the background painting for the benefit of animations |
| 2366 | /// |