示例#1
0
 void showCompanion(boolean switchTabs) {
   CompanionFacade companion = getSelectedCompanion();
   if (companion == null) {
     if (!switchTabs) {
       infoPane.setText(""); // $NON-NLS-1$
     }
     return;
   }
   if (isCompanionOpen(companion)) {
     CharacterFacade character = CharacterManager.getCharacterMatching(companion);
     if (character != null) {
       if (switchTabs) {
         frame.setSelectedCharacter(character);
         return;
       } else {
         sheetSupport.setCharacter(character);
         sheetSupport.refresh();
       }
     }
     // the companion was not found
     // TODO: show error, complain?
   } else if (switchTabs) {
     frame.loadCharacterFromFile(companion.getFileRef().getReference());
   } else {
     // Display a message telling the user to open the companion.
     infoPane.setText(
         LanguageBundle.getString("in_companionLoadCompanionMessage")); // $NON-NLS-1$
   }
 }