(CharacterFacade character)
| 141 | } |
| 142 | |
| 143 | @Override |
| 144 | public void setCharacter(CharacterFacade character) |
| 145 | { |
| 146 | modelService.cancelRestoreTasks(); |
| 147 | if (!stateMap.containsKey(character)) |
| 148 | { |
| 149 | //This is the first time this character has been added, so initialize the tab states. |
| 150 | for (int i = 0; i < getTabCount(); i++) |
| 151 | { |
| 152 | CharacterInfoTab tab = (CharacterInfoTab) getComponentAt(i); |
| 153 | ModelMap models = tab.createModels(character); |
| 154 | stateMap.put(character, tab, models); |
| 155 | } |
| 156 | String key = UIPropertyContext.C_PROP_INITIAL_TAB; |
| 157 | key = UIPropertyContext.createCharacterPropertyKey(character, key); |
| 158 | //defaults to the summary tab if prop doesn't exist |
| 159 | int startingTab = UIPropertyContext.getInstance().getInt(key, SUMMARY_TAB); |
| 160 | tabSelectionMap.put(character, startingTab); |
| 161 | } |
| 162 | if (currentCharacter != null) |
| 163 | { |
| 164 | Map<CharacterInfoTab, ModelMap> states = stateMap.getMapFor(currentCharacter); |
| 165 | modelService.storeModels(states); |
| 166 | //Save tabSelection for this character |
| 167 | tabSelectionMap.put(currentCharacter, getSelectedIndex()); |
| 168 | } |
| 169 | currentCharacter = character; |
| 170 | |
| 171 | Map<CharacterInfoTab, ModelMap> states = stateMap.getMapFor(character); |
| 172 | updateTabsForCharacter(character); |
| 173 | int selectedIndex = tabSelectionMap.get(character); |
| 174 | modelService.restoreModels(states, selectedIndex); |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Update the displayed tabs to reflect the settings of the game mode of the |
nothing calls this directly
no test coverage detected