private ResourceFile getResourceFileFor(Identifier templateId) {
   for (ResourceFile file : templateResources) {
     if (file.getFileName().endsWith("/" + templateId.getId() + ".template")) {
       return file;
     }
   }
   throw new IllegalStateException("No resource found for templateId " + templateId.getId());
 }
 @Override
 public void initPresentation() {
   for (Identifier generatorType : model.getGeneratorTypes()) {
     String formattedLabel = resources.getString(generatorType.getId());
     view.addNameGeneratorType(formattedLabel, generatorType);
   }
   initSelectedGeneratorTypePresentation();
   initGenerationPresentation();
 }
Пример #3
0
 @Override
 public String getLabel(PrintNameFile value) {
   String printName = value.getPrintName();
   CharacterReference reference = createReference(value);
   CharacterType characterType = scanner.getCharacterType(reference);
   String characterString = new CharacterTypeUi(resources).getLabel(characterType);
   Identifier casteType = scanner.getCasteType(reference);
   if (casteType == CasteType.NULL_CASTE_TYPE) {
     return resources.getString(
         "LoadCharacter.PrintNameFile.ShortMessage", printName, characterString);
   }
   String casteTypeString = resources.getString("Caste." + casteType.getId());
   String casteString = resources.getString(characterType.getId() + ".Caste.Label");
   return resources.getString(
       "LoadCharacter.PrintNameFile.Message",
       printName,
       characterString,
       casteTypeString,
       casteString);
 }