Author: tchemit Date: 2008-01-22 01:48:18 +0000 (Tue, 22 Jan 2008) New Revision: 189 Modified: trunk/jaxx/src/main/java/jaxx/runtime/builder/TabFactory.java Log: les mod?\195?\168les sont instanci?\195?\169s ind?\195?\169pendamment des ui (car on peut avoir besoin du mod?\195?\168le avant que l'ui ne soit instanci?\195?\169e) Modified: trunk/jaxx/src/main/java/jaxx/runtime/builder/TabFactory.java =================================================================== --- trunk/jaxx/src/main/java/jaxx/runtime/builder/TabFactory.java 2008-01-22 01:32:13 UTC (rev 188) +++ trunk/jaxx/src/main/java/jaxx/runtime/builder/TabFactory.java 2008-01-22 01:48:18 UTC (rev 189) @@ -70,18 +70,17 @@ JComponent instance; try { instance = (JComponent) config.impl().newInstance(); - log.info("new tab : " + instance); + log.info("new tab : " + instance); + cache.put(tabName, instance); + initJAXXTab(config, instance); - initTab(instance, tabName, config); - cache.put(tabName, instance); return instance; } catch (Exception e) { throw new RuntimeException(e); } - } public TabContentConfig getConfig(String tabName) { @@ -94,7 +93,20 @@ } public TabModel getModel(String tabName) { - return models.get(tabName); + + if (models.containsKey(tabName)) { + return models.get(tabName); + } + TabContentConfig config = getConfig(tabName); + TabModel tabModel; + try { + tabModel = config.model().newInstance(); + log.info("new tab model : " + tabModel); + models.put(tabName, tabModel); + } catch (Exception e) { + throw new RuntimeException(e); + } + return tabModel; } public void showTab(final JTabbedPane container, String tabName) { @@ -107,7 +119,7 @@ if (index == -1) { registerTab(container, tabName, config, comp); } - + container.setSelectedComponent(comp); }