1 | public void localeChanged(LocaleChangeEvent event) {↵ | | 1 | public void localeChanged(LocaleChangeEvent event) {↵
|
2 | // FIrst make sure we save the content of the current GUI (since we↵ | | 2 | // FIrst make sure we save the content of the current GUI (since we↵
|
3 | // will flush it away):↵ | | 3 | // will flush it away):↵
|
4 | updateCurrentNode();↵ | | 4 | updateCurrentNode();↵
|
|
5 | // Forget about all GUIs we've created so far: we'll need to re-created↵ | | 5 | // Forget about all GUIs we've created so far: we'll need to re-created↵
|
6 | // them all!↵ | | 6 | // them all!↵
|
7 | guis = new HashMap();↵ | | 7 | guis = new HashMap();↵
|
8 | nodesToGui = new HashMap();↵ | | 8 | nodesToGui = new HashMap();↵
|
9 | testBeanGUIs = new HashMap();↵ | | 9 | testBeanGUIs = new HashMap();↵
|
|
10 | // BeanInfo objects also contain locale-sensitive data -- flush them↵ | | 10 | // BeanInfo objects also contain locale-sensitive data -- flush them↵
|
11 | // away:↵ | | 11 | // away:↵
|
12 | Introspector.flushCaches();↵ | | 12 | Introspector.flushCaches();↵
|
|
13 | // Now put the current GUI in place. [This code was copied from the↵ | | 13 | // Now put the current GUI in place. [This code was copied from the↵
|
14 | // EditCommand action -- we can't just trigger the action because that↵ | | 14 | // EditCommand action -- we can't just trigger the action because that↵
|
15 | // would populate the current node with the contents of the new GUI --↵ | | 15 | // would populate the current node with the contents of the new GUI --↵
|
16 | // which is empty.]↵ | | 16 | // which is empty.]↵
|
17 | MainFrame mf = getMainFrame(); // Fetch once↵ | | 17 | ReportMainFrame mf = getMainFrame(); // Fetch once↵
|
18 | if (mf == null) // Probably caused by unit testing on headless system↵ | | 18 | if (mf == null) // Probably caused by unit testing on headless system↵
|
19 | {↵ | | 19 | {↵
|
20 | log.warn("Mainframe is null");↵ | | 20 | log.warn("Mainframe is null");↵
|
21 | } else {↵ | | 21 | } else {↵
|
22 | mf.setMainPanel((javax.swing.JComponent) getCurrentGui());↵ | | 22 | mf.setMainPanel((javax.swing.JComponent) getCurrentGui());↵
|
23 | mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());↵ | | 23 | mf.setEditMenu(getTreeListener().getCurrentNode().createPopupMenu());↵
|
24 | | | 24 |
|